diff --git a/BaseLib/FileTools.cpp b/BaseLib/FileTools.cpp index 3fef890ea666973ffbfdc289ca42529412589cad..4be8108333ec9f5e62dd93a885c7eef667aa4d6e 100644 --- a/BaseLib/FileTools.cpp +++ b/BaseLib/FileTools.cpp @@ -61,6 +61,11 @@ void truncateFile( std::string const& filename) ofs.close(); } +/** Finds the position of last file path separator. + * Checks for unix or windows file path separators in given path and returns the + * position of the last one or std::string::npos if no file path separator was + * found. + */ size_t findLastPathSeparator(std::string const& path) { return path.find_last_of("/\\"); diff --git a/BaseLib/FileTools.h b/BaseLib/FileTools.h index 113298dd311f66db1ad5ef9eadc2d0e17411457d..78d7b1e6c0bd28716a76e392ed9b7040cf0f5c42 100644 --- a/BaseLib/FileTools.h +++ b/BaseLib/FileTools.h @@ -21,13 +21,6 @@ namespace BaseLib { -/** Finds the position of last file path separator. - * Checks for unix or windows file path separators in given path and returns the - * position of the last one or std::string::npos if no file path separator was - * found. - */ -size_t findLastPathSeparator(std::string const& path); - /** * \brief Returns true if given file exists. From http://www.techbytes.ca/techbyte103.html * diff --git a/Tests/BaseLib/TestFilePathStringManipulation.cpp b/Tests/BaseLib/TestFilePathStringManipulation.cpp index 44d7f8d99a016f26e9b0a68dd52c88bf3ca05493..89a40f5565b6c72440ed550ce192b401c705758e 100644 --- a/Tests/BaseLib/TestFilePathStringManipulation.cpp +++ b/Tests/BaseLib/TestFilePathStringManipulation.cpp @@ -8,6 +8,7 @@ #include "gtest.h" #include "FileTools.h" +#include "FileTools.cpp" TEST(BaseLib, FindLastPathSeparatorWin) {