class
directoryhelper class that contains directory specific I/O manipulation methods and platform utilities.
static variables
static member functions
Function documentation
static psl:: string utility:: platform:: directory:: to_unix(psl:: string_view path)
Brief
translated the given path to one that is accepted on Unix systems
Parameters | |
---|---|
path in | the path to translate to one that works in unix systems. |
Returns | a string that should work on unix systems, and satisfies the requirements. |
static psl:: string utility:: platform:: directory:: to_windows(psl:: string_view path)
Brief
translated the given path to one that is accepted on Windows systems
Parameters | |
---|---|
path in | the path to translate to one that works in Windows systems. |
Returns | a string that should work on Windows systems, and satisfies the requirements. |
static psl:: string utility:: platform:: directory:: to_platform(psl:: string_view path)
Brief
translated the given path to one that is accepted on the current platform
Parameters | |
---|---|
path in | the path to translate to one that works on the current platform. |
Returns | a string that should work on the current platform, and satisfies the requirements. |
static psl:: string utility:: platform:: directory:: to_generic(psl:: string_view path)
Brief
translates the given path to the default path encoding that is used across this application as the standard.
Parameters | |
---|---|
path in | the path to translate. |
Returns | a string that is translated to the application-wide standard encoding (unix). |
static bool utility:: platform:: directory:: is_directory(psl:: string_view path)
Brief
checks if the given path is a directory.
Details
Parameters | |
---|---|
path in | the path to check. |
Returns | true in case it is a directory. |
static psl:: string utility:: platform:: directory:: sanitize(psl:: string_view path)
Brief
sanitizes the seperators into the application wide standard one.
Parameters | |
---|---|
path in | the path to sanitize. |
Returns | the transformed input path. |
static bool utility:: platform:: directory:: erase(psl:: string_view path)
Brief
tries to erase/delete the given item this path points to.
Details
tries to delete the file this path points to, or the folder this path points to.
Parameters | |
---|---|
path in | the path to what you wish to be erased. |
Returns | true if erasing the target item is successful. |
static bool utility:: platform:: directory:: exists(psl:: string_view absolutePath)
Brief
checks if the given path (absolute) points to a directory or not.
Parameters | |
---|---|
absolutePath in | the path to check. |
Returns | true in case this path is valid and points to a directory. |
static bool utility:: platform:: directory:: create(psl:: string_view absolutePath,
bool recursive = false)
Brief
creates a directory that satisfies this path.
Parameters | |
---|---|
absolutePath in | the path to create the directory at. |
recursive in | should we make all non-existing parent directories as well (true) or fail (false) when the path to the given directory does not exist? |
Returns | true if the path is now fully valid and the directory exists. |
static std::vector<psl:: string> utility:: platform:: directory:: all_files(psl:: string_view target_directory,
bool recursive)
Brief
gets all files in the target directory, no folders.
Details
gets all files in the target directory exluding the sub-directories. It however can recursively walk the sub-directories when needed, it will only return their contained items though.
Parameters | |
---|---|
target_directory in | the directory to run a search from. |
recursive in | should we also search the sub-directories (true), or not (false). |
Returns | a container of elements of the type psl:: |