OSG osgDB FileUtils FileNameUtil操作文件名相关函数
/** 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);
相关文章
- C#实现php的hash_hmac函数
- Sql Server 函数的操作实例!(执行多条语句,返回Select查询后的临时表)
- Jquery或Js中的字符串操作函数大全(搜集中)
- 【MATLAB教程案例13】基于SA模拟退火优化算法的函数极值计算matlab仿真及其他应用
- 图像的形态学开操作(开运算)和闭操作(闭运算)的概念和作用,并用OpenCV的函数morphologyEx()实现对图像的开闭操作
- 详解图像形态学操作之图形的腐蚀和膨胀的概念和运算过程,并利用OpenCV的函数erode()和函数dilate()对图像进行腐蚀和膨胀操作
- 使用C++的函数memset()时要注意它的操作对象是每一个字节
- C语言文件操作函数
- jQuery碎语(4) 实用函数
- JNI学习积累之三 ---- 操作JNI函数以及复杂对象传递
- python 操作excel 的包 函数
- 重点:怎样正确的使用QThread类(很多详细例子的对比,注意:QThread 中所有实现的函数是被创建它的线程来调用的,不是在线程中)good
- Vue3之生命周期钩子函数
- 【内存操作函数】
- 数据类型、深浅拷贝、编码、文件操作、函数、迭代器和生成器
- Linux散列表(一)——操作函数
- 【GoLang】2.3 函数
- SQL Server 函数的使用 Function
- 工作那些事(二十八)项目管理模式:项目类型、函数类型、矩阵
- JS 数组相关的操作函数
- 练习 2-6 编写一个函数setbits(x, p, n, y),该函数返回对x执行下列操作后的结果值:将x中从第p位开始的n个(二进制)位设置为y中最右边n位的值,x的其余各位保持不变。