|
RADLib
RADical C++ application framework
|
Filesystem helper namespace for paths, standard locations, MIME guesses, and text files. More...
Classes | |
| struct | DirectoryEntry |
| Directory listing entry with basic metadata. More... | |
Enumerations | |
| enum class | StandardPath { Home , Desktop , Documents , Downloads , Config , Data , Cache , Temp , Executable , Current } |
| Standard platform path categories. More... | |
| enum class | DirectoryEntryType { Unknown , File , Directory , Symlink } |
| Directory entry type. More... | |
Functions | |
| bool | exists (const std::string &path) |
| Returns true when path exists. More... | |
| bool | isFile (const std::string &path) |
| Returns true when path is a regular file. More... | |
| bool | isDirectory (const std::string &path) |
| Returns true when path is a directory. More... | |
| bool | createDirectories (const std::string &path) |
| Creates path and missing parents. More... | |
| bool | remove (const std::string &path) |
| Removes file or directory path. More... | |
| bool | copyFile (const std::string &source, const std::string &destination, bool overwrite=true) |
| Copies a file from source to destination. More... | |
| std::string | currentPath () |
| Returns current working directory. More... | |
| std::string | tempDirectoryPath () |
| Returns system temporary directory. More... | |
| std::string | standardPath (StandardPath path) |
| Returns a standard platform path. More... | |
| std::string | fileName (const std::string &path) |
| Returns filename component of path. More... | |
| std::string | extension (const std::string &path) |
| Returns extension component of path. More... | |
| std::string | parentPath (const std::string &path) |
| Returns parent directory path. More... | |
| std::vector< DirectoryEntry > | listEntries (const std::string &path, bool recursive=false) |
| Lists directory entries, recursively when requested. More... | |
| std::vector< std::string > | listDirectory (const std::string &path) |
| Lists child paths in a directory. More... | |
| std::string | mimeTypeForFile (const std::string &path) |
| Guesses MIME type from file contents or extension. More... | |
| std::optional< std::string > | readTextFile (const std::string &path) |
| Reads a UTF-8/text file into a string. More... | |
| bool | writeTextFile (const std::string &path, const std::string &text) |
| Writes text to a file. More... | |
Filesystem helper namespace for paths, standard locations, MIME guesses, and text files.
|
strong |
|
strong |
Standard platform path categories.
| bool RADCore::FileSystem::copyFile | ( | const std::string & | source, |
| const std::string & | destination, | ||
| bool | overwrite = true |
||
| ) |
Copies a file from source to destination.
| bool RADCore::FileSystem::createDirectories | ( | const std::string & | path | ) |
Creates path and missing parents.
| std::string RADCore::FileSystem::currentPath | ( | ) |
Returns current working directory.
| bool RADCore::FileSystem::exists | ( | const std::string & | path | ) |
Returns true when path exists.
| std::string RADCore::FileSystem::extension | ( | const std::string & | path | ) |
Returns extension component of path.
| std::string RADCore::FileSystem::fileName | ( | const std::string & | path | ) |
Returns filename component of path.
| bool RADCore::FileSystem::isDirectory | ( | const std::string & | path | ) |
Returns true when path is a directory.
| bool RADCore::FileSystem::isFile | ( | const std::string & | path | ) |
Returns true when path is a regular file.
| std::vector<std::string> RADCore::FileSystem::listDirectory | ( | const std::string & | path | ) |
Lists child paths in a directory.
| std::vector<DirectoryEntry> RADCore::FileSystem::listEntries | ( | const std::string & | path, |
| bool | recursive = false |
||
| ) |
Lists directory entries, recursively when requested.
| std::string RADCore::FileSystem::mimeTypeForFile | ( | const std::string & | path | ) |
Guesses MIME type from file contents or extension.
| std::string RADCore::FileSystem::parentPath | ( | const std::string & | path | ) |
Returns parent directory path.
| std::optional<std::string> RADCore::FileSystem::readTextFile | ( | const std::string & | path | ) |
Reads a UTF-8/text file into a string.
| bool RADCore::FileSystem::remove | ( | const std::string & | path | ) |
Removes file or directory path.
| std::string RADCore::FileSystem::standardPath | ( | StandardPath | path | ) |
Returns a standard platform path.
| std::string RADCore::FileSystem::tempDirectoryPath | ( | ) |
Returns system temporary directory.
| bool RADCore::FileSystem::writeTextFile | ( | const std::string & | path, |
| const std::string & | text | ||
| ) |
Writes text to a file.