cee::FileSystem
-
class FileSystem
Static class containing file system utility functions.
Public Static Functions
-
static Str fromNativeSeparators(const Str &path)
Converts path from using native separators to always use ‘/’ as separator.
-
static Str toNativeSeparators(const Str &path)
Returns path with separators that are appropriate for the underlying operating system.
-
static Str addTrailingSeparator(const Str &path)
Adds a trailing separator to the input path if one isn’t already present.
-
static Str removeTrailingSeparator(const Str &path)
Returns path with any trailing separators removed.
-
static Str fileName(const Str &path)
Returns the file name component of the path.
The returned file name will include the file extension
-
static bool createDirectory(const Str &dirName)
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 bool createDirectoryTree(const Str &dirPath)
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 bool deleteDirectory(const Str &dirName)
Deletes an empty directory.
The directory must be empty, and it must not be the current working directory or the root directory.
-
static bool deleteAllFilesInDirectory(const Str &dirName)
Deletes all files within the specified directory.
-
static bool deleteDirectoryRecursive(const Str &dirName)
Deletes a directory and all its contents recursively.
-
static bool getDirectoryContents(const Str &dirName, std::vector<Str> *fileNameArr, std::vector<Str> *dirNameArr)
Gets all files and sub-directories in the specified directory.
-
static std::vector<Str> getAllFilesInDirectory(const Str &dirName)
Gets all files in the specified directory.
-
static Str fromNativeSeparators(const Str &path)