1 #ifndef IOUTILITIES_PATHHELPER_H 2 #define IOUTILITIES_PATHHELPER_H 9 #ifdef PLATFORM_WINDOWS 10 #define PATH_SEP_CHAR '\\' 11 #define SEARCH_PATH_SEP_CHAR ';' 12 #define PATH_SEP_STR "\\" 13 #define SEARCH_PATH_SEP_STR ";" 15 #define PATH_SEP_CHAR '/' 16 #define SEARCH_PATH_SEP_CHAR ':' 17 #define PATH_SEP_STR "/" 18 #define SEARCH_PATH_SEP_STR ":" 30 return static_cast<DirectoryEntryType>(static_cast<unsigned char>(lhs) | static_cast<unsigned char>(rhs));
35 return (lhs = static_cast<DirectoryEntryType>(static_cast<unsigned char>(lhs) | static_cast<unsigned char>(rhs)));
40 return static_cast<DirectoryEntryType>(static_cast<unsigned char>(lhs) & static_cast<unsigned char>(rhs));
47 std::string &result, std::string applicationDirectoryName = std::string(),
bool createApplicationDirectory =
false);
51 #endif // IOUTILITIES_PATHHELPER_H #define CPP_UTILITIES_EXPORT
CPP_UTILITIES_EXPORT std::list< std::string > directoryEntries(const char *path, DirectoryEntryType types=DirectoryEntryType::All)
Returns the names of the directory entries in the specified path with the specified types.
constexpr DirectoryEntryType operator|(DirectoryEntryType lhs, DirectoryEntryType rhs)
constexpr DirectoryEntryType operator &(DirectoryEntryType lhs, DirectoryEntryType rhs)
CPP_UTILITIES_EXPORT bool settingsDirectory(std::string &result, std::string applicationDirectoryName=std::string(), bool createApplicationDirectory=false)
Locates a directory meant to store application settings.
Contains utility classes helping to read and write streams.
DirectoryEntryType & operator|=(DirectoryEntryType &lhs, DirectoryEntryType rhs)
CPP_UTILITIES_EXPORT std::string directory(const std::string &path)
Returns the directory of the specified path string (including trailing slash).
CPP_UTILITIES_EXPORT std::string fileName(const std::string &path)
Returns the file name and extension of the specified path string.
CPP_UTILITIES_EXPORT void removeInvalidChars(std::string &fileName)
Removes invalid characters from the specified fileName.
DirectoryEntryType
The DirectoryEntryType enum specifies the type of a directory entry (file, directory or symlink).