A class for handling system files and paths using UTF-8 strings. More...
#include <FileSystem.h>
Static Public Member Functions | |
static std::string | absolutePath (const std::string &path) |
Retrives the absolute path for the given path in UTF-8. More... | |
static void | copyFile (const std::string &from, const std::string &to) |
Copies a file. More... | |
static bool | createDirectories (const std::string &path) |
Creates a directory for any element of path that does not exist. More... | |
static bool | createDirectory (const std::string &path) |
Creates a directory from a given path in UTF-8. More... | |
static std::string | currentPath () |
Retrives the current working directory path in UTF-8. More... | |
static std::string | executableDirectory () |
static bool | exists (const std::string &path) |
Checks if a given path in UTF-8 exists. More... | |
static std::string | extension (const std::string &path) |
Retrives the extension of a given file path in UTF-8. More... | |
static std::string | fileName (const std::string &path) |
Retrives the filename of a given file path in UTF-8, including extension. More... | |
static uintmax_t | fileSize (const std::string &path) |
Returns the file size of a FILE in UTF-8. More... | |
static bool | isDirectory (const std::string &path) |
Checks if a given path in UTF-8 is a directory. More... | |
static bool | isEmpty (const std::string &path) |
Checks if a given path in UTF-8 is an empty directory. More... | |
static bool | isRegularFile (const std::string &path) |
Checks if a given path in UTF-8 is a regular file. More... | |
static std::vector< std::string > | listDirectory (const std::string &path) |
Lists a directory from a given path in UTF-8. More... | |
static std::string | parentPath (const std::string &path) |
Retrives the parent path of a given file path in UTF-8. For /home/files/fileName.shp, it will return /home/files. More... | |
static bool | remove (const std::string &path) |
Removes a file or directory from a given path in UTF-8. More... | |
static void | rename (const std::string &old_p, const std::string &new_p) |
Renames a file or directory from a given path in UTF-8. More... | |
static std::string | stem (const std::string &path) |
Retrives the filename of a given file path in UTF-8, excluding extension. More... | |
static std::string | systemCompletePath (const std::string &path) |
Composes an absolute path for the given path in UTF-8. More... | |
static std::string | tempDirectoryPath () |
Retrives the temp directory in UTF-8. More... | |
static std::string | uniquePath (const std::string &format="%%%%-%%%%-%%%%-%%%%") |
Retrives an unique path generated by a given format. More... | |
Private Member Functions | |
FileSystem () | |
FileSystem (FileSystem const &) | |
FileSystem & | operator= (FileSystem const &) |
~FileSystem () | |
A class for handling system files and paths using UTF-8 strings.
Definition at line 50 of file FileSystem.h.
|
private |
|
private |
|
private |
|
static |
Retrives the absolute path for the given path in UTF-8.
path | Path in UTF-8. |
|
static |
Copies a file.
from | Path in UTF-8 for the file to be copied. |
to | Path in UTF-8 for the copy output. |
|
static |
Creates a directory for any element of path that does not exist.
path | Path in UTF-8. |
|
static |
Creates a directory from a given path in UTF-8.
path | Path in UTF-8. |
|
static |
Retrives the current working directory path in UTF-8.
|
static |
|
static |
Checks if a given path in UTF-8 exists.
path | Path in UTF-8. |
|
static |
Retrives the extension of a given file path in UTF-8.
path | File path in UTF-8. |
|
static |
Retrives the filename of a given file path in UTF-8, including extension.
path | File path in UTF-8. |
|
static |
Returns the file size of a FILE in UTF-8.
path | Path in UTF-8. |
te::core::Exception | if the given path doesn't exists or its used in a directory. |
|
static |
Checks if a given path in UTF-8 is a directory.
path | Path in UTF-8. |
|
static |
Checks if a given path in UTF-8 is an empty directory.
path | Path in UTF-8. |
|
static |
Checks if a given path in UTF-8 is a regular file.
path | File path in UTF-8. |
Referenced by te::common::ApplicationSettings::load().
|
static |
Lists a directory from a given path in UTF-8.
path | Path in UTF-8. |
|
private |
|
static |
Retrives the parent path of a given file path in UTF-8. For /home/files/fileName.shp, it will return /home/files.
path | File path in UTF-8. |
|
static |
Removes a file or directory from a given path in UTF-8.
path | Path in UTF-8. |
Referenced by te::common::ApplicationSettings::update().
|
static |
Renames a file or directory from a given path in UTF-8.
old_p | Old name in UTF-8. |
new_p | New name in UTF-8. |
|
static |
Retrives the filename of a given file path in UTF-8, excluding extension.
path | File path in UTF-8. |
|
static |
Composes an absolute path for the given path in UTF-8.
path | Path in UTF-8. |
|
static |
Retrives the temp directory in UTF-8.
|
static |
Retrives an unique path generated by a given format.
format | The format used to create a unique path. e.g.: "%%%%-%%%%-%%%%-%%%%" |
Referenced by te::rp::Matrix< rg::BaatzFeatureType >::createNewDiskFile().