本文整理汇总了C++中SplFileInfo类的典型用法代码示例。如果您正苦于以下问题:C++ SplFileInfo类的具体用法?C++ SplFileInfo怎么用?C++ SplFileInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SplFileInfo类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: f_hphp_splfileinfo_getpath
String f_hphp_splfileinfo_getpath(CObjRef obj) {
SplFileInfo *fileInfo = get_splfileinfo(obj);
const char *fileName = fileInfo->getFileName().c_str();
const char *p1 = strrchr(fileName, '/');
if (!p1) return "";
return String(fileName, p1 - fileName, CopyString);
}
示例2: f_hphp_splfileinfo_getlinktarget
String f_hphp_splfileinfo_getlinktarget(CObjRef obj) {
SplFileInfo *fileInfo = get_splfileinfo(obj);
String ret = f_readlink_internal(fileInfo->getFileName(), false);
if (!ret.size()) {
throw Object(SystemLib::AllocExceptionObject(Variant(
"Unable to read link "+std::string(fileInfo->getFileName()) +
", error: no such file or directory")));
}
return ret;
}
示例3: f_hphp_splfileinfo_getlinktarget
String f_hphp_splfileinfo_getlinktarget(CObjRef obj) {
SplFileInfo *fileInfo = get_splfileinfo(obj);
String ret = f_readlink_internal(fileInfo->getFileName(), false);
if (!ret.size()) {
throw (Object)sp_exception(NEW(c_exception)())->create(Variant(
"Unable to read link "+fileInfo->getFileName()
+", error: no such file or directory"));
}
return ret;
}
示例4: f_hphp_splfileinfo_getinode
int64_t f_hphp_splfileinfo_getinode(CObjRef obj) {
SplFileInfo *fileInfo = get_splfileinfo(obj);
return f_fileinode(fileInfo->getFileName());
}
示例5: f_hphp_splfileinfo_getfilename
String f_hphp_splfileinfo_getfilename(CObjRef obj) {
SplFileInfo *fileInfo = get_splfileinfo(obj);
return f_basename(fileInfo->getFileName());
}
示例6: f_hphp_splfileinfo_getbasename
String f_hphp_splfileinfo_getbasename(CObjRef obj, CStrRef suffix) {
SplFileInfo *fileInfo = get_splfileinfo(obj);
return f_basename(fileInfo->getFileName(), suffix);
}
示例7: f_hphp_splfileinfo___tostring
String f_hphp_splfileinfo___tostring(CObjRef obj) {
SplFileInfo *fileInfo = get_splfileinfo(obj);
return fileInfo->getFileName();
}
示例8: f_hphp_splfileinfo_openfile
Object f_hphp_splfileinfo_openfile(CObjRef obj, CStrRef open_mode, bool use_include_path, CVarRef context) {
SplFileInfo *fileInfo = get_splfileinfo(obj);
return SystemLib::AllocSplFileObjectObject(
String(fileInfo->getFileName()), open_mode, use_include_path, context);
}
示例9: f_hphp_splfileinfo_iswritable
bool f_hphp_splfileinfo_iswritable(CObjRef obj) {
SplFileInfo *fileInfo = get_splfileinfo(obj);
return f_is_writable(fileInfo->getFileName());
}
示例10: f_hphp_splfileinfo_islink
bool f_hphp_splfileinfo_islink(CObjRef obj) {
SplFileInfo *fileInfo = get_splfileinfo(obj);
return f_is_link(fileInfo->getFileName());
}
示例11: f_hphp_splfileinfo_getrealpath
Variant f_hphp_splfileinfo_getrealpath(CObjRef obj) {
SplFileInfo *fileInfo = get_splfileinfo(obj);
return f_realpath(fileInfo->getFileName());
}
示例12: f_hphp_splfileinfo_getgroup
int64 f_hphp_splfileinfo_getgroup(CObjRef obj) {
SplFileInfo *fileInfo = get_splfileinfo(obj);
return f_filegroup(fileInfo->getFileName());
}
示例13: f_hphp_splfileinfo_openfile
Object f_hphp_splfileinfo_openfile(CObjRef obj, CStrRef open_mode, bool use_include_path, CVarRef context) {
SplFileInfo *fileInfo = get_splfileinfo(obj);
return p_SplFileObject(p_SplFileObject(NEWOBJ(c_SplFileObject)())->
create(String(fileInfo->getFileName()),
open_mode, use_include_path, context));
}