当前位置: 首页>>代码示例>>C++>>正文


C++ SplFileInfo类代码示例

本文整理汇总了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);
}
开发者ID:CyaLiven,项目名称:hiphop-php,代码行数:7,代码来源:ext_splfile.cpp

示例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;
}
开发者ID:CyaLiven,项目名称:hiphop-php,代码行数:10,代码来源:ext_splfile.cpp

示例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;
}
开发者ID:GunioRobot,项目名称:hiphop-php,代码行数:10,代码来源:ext_splfile.cpp

示例4: f_hphp_splfileinfo_getinode

int64_t f_hphp_splfileinfo_getinode(CObjRef obj) {
  SplFileInfo *fileInfo = get_splfileinfo(obj);
  return f_fileinode(fileInfo->getFileName());
}
开发者ID:CyaLiven,项目名称:hiphop-php,代码行数:4,代码来源:ext_splfile.cpp

示例5: f_hphp_splfileinfo_getfilename

String f_hphp_splfileinfo_getfilename(CObjRef obj) {
  SplFileInfo *fileInfo = get_splfileinfo(obj);
  return f_basename(fileInfo->getFileName());
}
开发者ID:CyaLiven,项目名称:hiphop-php,代码行数:4,代码来源:ext_splfile.cpp

示例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);
}
开发者ID:CyaLiven,项目名称:hiphop-php,代码行数:4,代码来源:ext_splfile.cpp

示例7: f_hphp_splfileinfo___tostring

String f_hphp_splfileinfo___tostring(CObjRef obj) {
  SplFileInfo *fileInfo = get_splfileinfo(obj);
  return fileInfo->getFileName();
}
开发者ID:CyaLiven,项目名称:hiphop-php,代码行数:4,代码来源:ext_splfile.cpp

示例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);
}
开发者ID:CyaLiven,项目名称:hiphop-php,代码行数:5,代码来源:ext_splfile.cpp

示例9: f_hphp_splfileinfo_iswritable

bool f_hphp_splfileinfo_iswritable(CObjRef obj) {
  SplFileInfo *fileInfo = get_splfileinfo(obj);
  return f_is_writable(fileInfo->getFileName());
}
开发者ID:CyaLiven,项目名称:hiphop-php,代码行数:4,代码来源:ext_splfile.cpp

示例10: f_hphp_splfileinfo_islink

bool f_hphp_splfileinfo_islink(CObjRef obj) {
  SplFileInfo *fileInfo = get_splfileinfo(obj);
  return f_is_link(fileInfo->getFileName());
}
开发者ID:CyaLiven,项目名称:hiphop-php,代码行数:4,代码来源:ext_splfile.cpp

示例11: f_hphp_splfileinfo_getrealpath

Variant f_hphp_splfileinfo_getrealpath(CObjRef obj) {
  SplFileInfo *fileInfo = get_splfileinfo(obj);
  return f_realpath(fileInfo->getFileName());
}
开发者ID:CyaLiven,项目名称:hiphop-php,代码行数:4,代码来源:ext_splfile.cpp

示例12: f_hphp_splfileinfo_getgroup

int64 f_hphp_splfileinfo_getgroup(CObjRef obj) {
  SplFileInfo *fileInfo = get_splfileinfo(obj);
  return f_filegroup(fileInfo->getFileName());
}
开发者ID:ArPharazon,项目名称:hiphop-php,代码行数:4,代码来源:ext_splfile.cpp

示例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));
}
开发者ID:ArPharazon,项目名称:hiphop-php,代码行数:6,代码来源:ext_splfile.cpp


注:本文中的SplFileInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。