1#define CPP_UTILITIES_PATHHELPER_STRING_VIEW
19 return std::string(
fileName(std::string_view(path)));
27 return std::string(
directory(std::string_view(path)));
33std::string_view
fileName(std::string_view path)
40 }
else if (
lastSlash == std::string::npos) {
59 return std::string_view();
60 }
else if (
lastSlash == std::string::npos) {
78 static const char invalidPathChars[] = {
'\"',
'<',
'>',
'?',
'!',
'*',
'|',
'/',
':',
'\\',
'\n' };
Contains all utilities provides by the c++utilities library.
IntegralType stringToNumber(const StringType &string, BaseType base=10)
Converts the given string to an unsigned/signed number assuming string uses the specified base.
CPP_UTILITIES_EXPORT void removeInvalidChars(std::string &fileName)
Removes invalid characters from the specified fileName.
CPP_UTILITIES_EXPORT std::string fileName(const std::string &path)
Returns the file name and extension of the specified path string.
CPP_UTILITIES_EXPORT std::string directory(const std::string &path)
Returns the directory of the specified path string (including trailing slash).