/** Gets the parent path from full name (Ex: /a/b/c.Ext => /a/b). */
extern OSGDB_EXPORT std::string getFilePath(const std::string& filename);
/** Gets the extension without dot (Ex: /a/b/c.Ext => Ext). */
extern OSGDB_EXPORT std::string getFileExtension(const std::string& filename);
/** Gets the extension including dot (Ex: /a/b/c.Ext => .Ext). */
extern OSGDB_EXPORT std::string getFileExtensionIncludingDot(const std::string& filename);
/** Gets the lowercase extension without dot (Ex: /a/b/c.Ext => ext). */
extern OSGDB_EXPORT std::string getLowerCaseFileExtension(const std::string& filename);
/** Gets file name with extension (Ex: /a/b/c.Ext => c.Ext). */
extern OSGDB_EXPORT std::string getSimpleFileName(const std::string& fileName);
/** Gets file path without last extension (Ex: /a/b/c.Ext => /a/b/c ; file.ext1.ext2 => file.ext1). */
extern OSGDB_EXPORT std::string getNameLessExtension(const std::string& fileName);
/** Gets file path without \b all extensions (Ex: /a/b/c.Ext => /a/b/c ; file.ext1.ext2 => file). */
extern OSGDB_EXPORT std::string getNameLessAllExtensions(const std::string& fileName);
/** Gets file name without last extension (Ex: /a/b/c.Ext => c ; file.ext1.ext2 => file.ext1). */
extern OSGDB_EXPORT std::string getStrippedName(const std::string& fileName);
/** If 'to' is in a subdirectory of 'from' then this function returns the subpath, otherwise it just returns the file name.
* The function does \b not automagically resolve paths as the system does, so be careful to give canonical paths.
* However, the function interprets slashes ('/') ans backslashes ('\') as they were equal.
*/
extern OSGDB_EXPORT std::string getPathRelative(const std::string& from, const std::string& to);
/** Gets root part of a path ("/" or "C:"), or an empty string if none found. */
extern OSGDB_EXPORT std::string getPathRoot(const std::string& path);
/** Tests if path is absolute, as !getPathRoot(path).empty(). */
extern OSGDB_EXPORT bool isAbsolutePath(const std::string& path);

获取一个目录下全部文件名列表

osgDB::DirectoryContents dc=osgDB::getDirectoryContents(target_dir);

OSG osgDB FileUtils FileNameUtil操作文件名相关函数的更多相关文章

  1. Android FileUtils 文件操作类

    系统路径 Context.getPackageName(); // 用于获取APP的所在包目录 Context.getPackageCodePath(); //来获得当前应用程序对应的apk文件的路径 ...

  2. day08-Python运维开发基础(文件操作与相关函数、函数基础)

    1. 文件操作及相关函数 # ### 文件操作 """ fp = open("文件名称",mode=模式,encoding=编码集) fp 文件io对 ...

  3. [osg]osgDB的加载机制,使用3DS插件做参考(转,整理现有osgDB资料)

    参考:http://blog.sina.com.cn/s/blog_7cdaf8b60102uzu3.html http://blog.csdn.net/wang15061955806/article ...

  4. [原][资料整理][osg]osgDB文件读取插件,工作机制,支持格式,自定义插件

    参考: osgPlugins相关 osg读取文件的原理(插件工作机制) 当使用osgDB读取文件时,会自动根据文件的扩展名来到插件目录中寻找相应的插件,来实现. 比如: osgviewer cow.o ...

  5. osg osgDB::Options noTexturesInIVEFile ForceReadingImage dds_flip

    osgDB::writeNodeFile(node, path, new osgDB::Options("noTexturesInIVEFile")); noTexturesInI ...

  6. php数据库操作常用相关函数

    MySQL访问函数都需要有相应的权限才能运行.常用的相关函数介绍如下: (1)integer mysql_connect(主机,用户名,口令); 此函数开始一个对指定主机上的MySQL数据库的连接.若 ...

  7. [19/04/04-星期四] IO技术_CommonsIO(通用IO,别人造的轮子,FileUtils类 操作文件 & IOUtilsl类 操作里边的内容 )

    一.概念 JDK中提供的文件操作相关的类,但是功能都非常基础,进行复杂操作时需要做大量编程工作.实际开发中,往往需要 你自己动手编写相关的代码,尤其在遍历目录文件时,经常用到递归,非常繁琐. Apac ...

  8. java使用FileUtils文件操作神器

    前言: 在工作当中我们往往遇到很多文件的操作,我们也习惯写一些自己定义的工具类来简化文件操作,其实apache的commons的FileUtils类就是这样一个工具类,使用它能大大的简化我们对文件的操 ...

  9. PHP操作Redis相关函数

    String数据类型 $redis->set('key','TK'); $redis->set('number','1'); //设置值 $redis->setex('key',5, ...

随机推荐

  1. HDU 5122 K.Bro Sorting(2014北京区域赛现场赛K题 模拟)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5122 解题报告:定义一种排序算法,每一轮可以随机找一个数,把这个数与后面的比这个数小的交换,一直往后判 ...

  2. iOS开发——高级篇——iOS 中的 NSTimer

    以前的老代码在使用 NSTimer 时出现了内存泄露 NSTimer fire 我们先用 NSTimer 来做个简单的计时器,每隔5秒钟在控制台输出 Fire .比较想当然的做法是这样的: 1 2 3 ...

  3. 跟着百度学PHP[2]-foreach条件嵌套

    任务 通过二维数组,保存了学号.姓名和成绩,可以通过两个循环嵌套,遍历出学号和姓名. <?php $student = array( '001' => array("王大牛&qu ...

  4. FTP 传输中的主动模式和被动模式

    最近做一个项目用到FTP和其它系统进行文件传输,结果在FTP网络连接的问题上花了很多时间,由于太久没搞多FTP,忘记了FTP不单单开放21端口,客户端采用不同连接模式对网络有不同.在此重温一下FTP的 ...

  5. 2016年10月12日--string、Math类、Random随机数、DateTime、异常保护

    string string.length; //得到string长度 string.Trim(); //去掉string前后的空格 string.TrimStart(); //去掉string前的空格 ...

  6. Tip

    Windows 开栈命令 -Wl,--stack=1000000000 //stack-size B Linux 开栈命令 -ulimit -a -ulimit -s size //stack-siz ...

  7. python——tuple元组

    >>> dir(tuple) ['__add__', '__class__', '__contains__', '__delattr__', '__doc__', '__eq__', ...

  8. 3.7---猫狗收容所(CC150)

    解答的思路:建立一个queue放狗,一个queue放猫. 如下: import java.util.*; class Dog{ int time; int value; Dog(int a, int ...

  9. 1.8---字符串是否是旋转而成(CC150)

    答案:利用了XY , YX中第一个XYXY包含了第二个 public class Solution{ public static void main(String[] args){ System.ou ...

  10. postgresql 函数&存储过程 ; 递归查询

    函数:http://my.oschina.net/Kenyon/blog/108303 紧接上述,补充一下: 输入/输出参数的函数demo(输入作为变量影响sql结果,输出作为结果返回) create ...