Added getExtensionIncludingDot to provide more efficient handling of extensions
This commit is contained in:
parent
922b85b386
commit
48fe06fec3
@ -22,6 +22,7 @@ namespace osgDB {
|
||||
|
||||
extern OSGDB_EXPORT std::string getFilePath(const std::string& filename);
|
||||
extern OSGDB_EXPORT std::string getFileExtension(const std::string& filename);
|
||||
extern OSGDB_EXPORT std::string getFileExtensionIncludingDot(const std::string& filename);
|
||||
extern OSGDB_EXPORT std::string getLowerCaseFileExtension(const std::string& filename);
|
||||
extern OSGDB_EXPORT std::string getSimpleFileName(const std::string& fileName);
|
||||
extern OSGDB_EXPORT std::string getNameLessExtension(const std::string& fileName);
|
||||
|
@ -66,6 +66,13 @@ std::string osgDB::getFileExtension(const std::string& fileName)
|
||||
return std::string(fileName.begin()+dot+1,fileName.end());
|
||||
}
|
||||
|
||||
std::string osgDB::getFileExtensionIncludingDot(const std::string& fileName)
|
||||
{
|
||||
std::string::size_type dot = fileName.find_last_of('.');
|
||||
if (dot==std::string::npos) return std::string("");
|
||||
return std::string(fileName.begin()+dot,fileName.end());
|
||||
}
|
||||
|
||||
std::string osgDB::convertFileNameToWindowsStyle(const std::string& fileName)
|
||||
{
|
||||
std::string new_fileName(fileName);
|
||||
|
Loading…
Reference in New Issue
Block a user