Skip to content
Snippets Groups Projects
Commit dffaa076 authored by Tom Fischer's avatar Tom Fischer
Browse files

made dropFileExtension() a function usable from anywhere

changed dropFileExtension() implementation
parent c5b613d0
No related branches found
No related tags found
No related merge requests found
...@@ -87,7 +87,7 @@ std::string dropFileExtension(std::string const& filename) ...@@ -87,7 +87,7 @@ std::string dropFileExtension(std::string const& filename)
if (p == std::string::npos) if (p == std::string::npos)
return filename; return filename;
return filename.substr(0, filename.length() - p); return filename.substr(0, p);
} }
std::string extractBaseName(std::string const& pathname) std::string extractBaseName(std::string const& pathname)
......
...@@ -75,6 +75,11 @@ std::string getFileExtension(std::string const& filename); ...@@ -75,6 +75,11 @@ std::string getFileExtension(std::string const& filename);
*/ */
bool hasFileExtension(std::string const& extension, std::string const& filename); bool hasFileExtension(std::string const& extension, std::string const& filename);
/** Returns a string with file extension as found by getFileExtension()
* dropped.
*/
std::string dropFileExtension(std::string const& filename);
/** /**
* Checks if file_name already contains a qualified path and if not copies the * Checks if file_name already contains a qualified path and if not copies the
* path from source. * path from source.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment