Static class containing file system utility functions. More...
Static Public Member Functions | |
static Str | fromNativeSeparators (const Str &path) |
Converts path from using native separators to always use '/' as separator. More... | |
static Str | toNativeSeparators (const Str &path) |
Returns path with separators that are appropriate for the underlying operating system. More... | |
static Str | addTrailingSeparator (const Str &path) |
Adds a trailing separator to the input path if one isn't already present. More... | |
static Str | removeTrailingSeparator (const Str &path) |
Returns path with any trailing separators removed. More... | |
static Str | fileName (const Str &path) |
Returns the file name component of the path. More... | |
static Str | extension (const Str &path) |
Returns the file extension, including the leading '.'. More... | |
static Str | parentPath (const Str &path) |
Returns the parent path of the specified input path. More... | |
static Str | makeAbsolute (const Str &path) |
Convert a relative path to an absolute path. More... | |
static Str | currentPath () |
Returns the full path of the current working directory. More... | |
static bool | pathExists (const Str &pathName) |
Checks whether the specified file or directory exists. More... | |
static bool | fileExists (const Str &fileName) |
Returns true if the specified file exists. More... | |
static bool | directoryExists (const Str &dirName) |
Returns true if the specified directory exists. More... | |
static bool | createDirectory (const Str &dirName) |
Creates a directory. More... | |
static bool | createDirectoryTree (const Str &dirPath) |
Creates the directory path dirPath. More... | |
static bool | copyFile (const Str &fromFileName, const Str &toFileName) |
Copies a file. More... | |
static bool | deleteFile (const Str &fileName) |
Deletes a file. More... | |
static bool | deleteDirectory (const Str &dirName) |
Deletes an empty directory. More... | |
static bool | deleteAllFilesInDirectory (const Str &dirName) |
Deletes all files within the specified directory. More... | |
static bool | deleteDirectoryRecursive (const Str &dirName) |
Deletes a directory and all its contents recursively. More... | |
static bool | getDirectoryContents (const Str &dirName, std::vector< Str > *fileNameArr, std::vector< Str > *dirNameArr) |
Gets all files and sub-directories in the specified directory. More... | |
static std::vector< Str > | getAllFilesInDirectory (const Str &dirName) |
Gets all files in the specified directory. More... | |
static std::vector< Str > | findFilesInDirectory (const Str &dirName, const Str &filePattern) |
Returns all files matching filePattern in the specified directory. More... | |
static uint64_t | fileSize (const Str &fileName) |
Returns the size of the given file in bytes. More... | |
static unsigned int | fileContentsCrc (const Str &fileName, uint64_t maxBytesToRead) |
Returns the computed CRC of the contents of the given file. More... | |
Static class containing file system utility functions.
Adds a trailing separator to the input path if one isn't already present.
Copies a file.
|
static |
Creates a directory.
Creates only one new directory per call, so only the last component of dirName can name a new directory.
If the directory already exists when this function is called, it will return false.
|
static |
Creates the directory path dirPath.
The function will try to create all parent directories necessary to create the directory.
Returns true if successful or if the path already exists, otherwise returns false.
|
static |
Returns the full path of the current working directory.
|
static |
Deletes all files within the specified directory.
|
static |
Deletes an empty directory.
The directory must be empty, and it must not be the current working directory or the root directory.
|
static |
Deletes a directory and all its contents recursively.
|
static |
Deletes a file.
|
static |
Returns true if the specified directory exists.
Returns the file extension, including the leading '.'.
|
static |
Returns the computed CRC of the contents of the given file.
If maxBytesToRead > 0, only the first maxBytesToRead bytes of the file will be used.
|
static |
Returns true if the specified file exists.
Returns the file name component of the path.
The returned file name will include the file extension
|
static |
Returns the size of the given file in bytes.
|
static |
Returns all files matching filePattern in the specified directory.
Converts path from using native separators to always use '/' as separator.
Gets all files in the specified directory.
|
static |
Gets all files and sub-directories in the specified directory.
Convert a relative path to an absolute path.
Returns the parent path of the specified input path.
|
static |
Checks whether the specified file or directory exists.
Returns path with any trailing separators removed.