![]() |
DUNE: Uniform Navigational Environment
2019.02.0
|
Public Types | |
| enum | Type { PT_DIRECTORY, PT_FILE, PT_DEVICE, PT_LINK, PT_INVALID } |
| enum | Mode { MODE_NORMAL, MODE_RECURSIVE } |
Public Member Functions | |
| Path (void) | |
| Path (const char *path) | |
| Path (const std::string &path) | |
| Type | type (void) const |
| bool | exists (void) const |
| bool | isFile (void) const |
| bool | isDirectory (void) const |
| bool | isLink (void) const |
| bool | isDevice (void) const |
| bool | isAbsolute (void) const |
| int64_t | size (void) const |
| time_t | getLastModifiedTime (void) const |
| void | remove (Mode mode=MODE_NORMAL) const |
| void | create (Mode mode=MODE_RECURSIVE) const |
| void | copy (const Path &destination) const |
| Path | absolute (void) const |
| Path | root (void) const |
| Path | basename (void) const |
| Path | dirname (bool include_last_sep=true) const |
| std::string | extension (void) const |
| std::string | suffix (const Path &path, bool keep_first_sep=false) const |
| void | normalize (void) |
| void | contents (std::vector< Path > &dirs) const |
| void | contents (std::vector< Path > &dirs, int min_depth, int max_depth, int depth=0) const |
| void | clear (void) |
| bool | empty (void) const |
| const std::string & | str (void) const |
| const char * | c_str (void) const |
Static Public Member Functions | |
| static const char * | separator (void) |
| static unsigned int | separatorLength (void) |
| static uint64_t | storageCapacity (const Path &path) |
| static uint64_t | storageAvailable (const Path &path) |
| static Path | current (void) |
| static Path | applicationFile (void) |
|
inline |
References normalize().
|
inline |
References normalize().
|
inline |
References current(), separator(), and str().
|
static |
Retrieve the full path of the application's executable.
References DUNE::Utils::String::format(), and size().
Referenced by DUNE::Coordinates::WMM::WMM().
| Path DUNE::FileSystem::Path::basename | ( | void | ) | const |
References separator().
Referenced by storageAvailable(), and storageCapacity().
|
inline |
| void DUNE::FileSystem::Path::clear | ( | void | ) |
|
inline |
Referenced by contents(), and DUNE::Hardware::LUCL::Protocol::searchNewFirmware().
| void DUNE::FileSystem::Path::contents | ( | std::vector< Path > & | dirs, |
| int | min_depth, | ||
| int | max_depth, | ||
| int | depth = 0 |
||
| ) | const |
| void DUNE::FileSystem::Path::create | ( | Mode | mode = MODE_RECURSIVE | ) | const |
Create the path in the filesystem.
Only valid for directories.
| mode | creation mode. |
References isAbsolute(), isDirectory(), MODE_NORMAL, MODE_RECURSIVE, Path(), root(), separator(), DUNE::Utils::String::split(), and str().
Referenced by DUNE::Daemon::Daemon().
|
static |
Retrieve the full path of the current working directory.
Referenced by absolute().
| Path DUNE::FileSystem::Path::dirname | ( | bool | include_last_sep = true | ) | const |
References separator().
| bool DUNE::FileSystem::Path::empty | ( | void | ) | const |
|
inline |
Check if the path exists.
References PT_INVALID, and type().
| std::string DUNE::FileSystem::Path::extension | ( | void | ) | const |
| time_t DUNE::FileSystem::Path::getLastModifiedTime | ( | void | ) | const |
References c_str().
| bool DUNE::FileSystem::Path::isAbsolute | ( | void | ) | const |
Check if the path is absolute.
References separator(), and separatorLength().
Referenced by create(), normalize(), and root().
|
inline |
Check if the path is a device file.
References PT_DEVICE, and type().
Referenced by DUNE::Math::Random::KernelDevice::available().
|
inline |
Check if the path is a directory.
References PT_DIRECTORY, and type().
Referenced by contents(), DUNE::Tasks::Context::Context(), create(), remove(), storageAvailable(), and storageCapacity().
|
inline |
|
inline |
| void DUNE::FileSystem::Path::normalize | ( | void | ) |
References DUNE::Utils::String::filterDuplicates(), isAbsolute(), DUNE::Utils::String::join(), separator(), and DUNE::Utils::String::split().
Referenced by Path().
| void DUNE::FileSystem::Path::remove | ( | Mode | mode = MODE_NORMAL | ) | const |
Remove the path from the filesystem.
| mode | removal mode. |
References isDirectory(), MODE_RECURSIVE, Path(), and DUNE::FileSystem::Directory::RD_FULL_NAME.
| Path DUNE::FileSystem::Path::root | ( | void | ) | const |
References isAbsolute(), Path(), separator(), and separatorLength().
Referenced by create().
|
static |
Retrieve the string/character used as directory separator.
Referenced by absolute(), basename(), create(), dirname(), isAbsolute(), normalize(), DUNE::FileSystem::operator/(), root(), and suffix().
|
static |
Retrieve the length of the directory separator string.
Referenced by isAbsolute(), root(), and suffix().
| int64_t DUNE::FileSystem::Path::size | ( | void | ) | const |
References c_str().
Referenced by applicationFile().
|
static |
Retrieve the amount of available storage of the device in which a path resides.
| path | path. |
References basename(), c_str(), isDirectory(), and str().
|
static |
Retrieve the capacity of the device in which a path resides.
| path | path. |
References basename(), c_str(), isDirectory(), and str().
Referenced by DUNE::Daemon::Daemon().
|
inline |
Referenced by absolute(), DUNE::FileSystem::Directory::close(), copy(), create(), DUNE::FileSystem::Directory::open(), DUNE::FileSystem::operator!=(), DUNE::FileSystem::operator+(), DUNE::FileSystem::operator+=(), DUNE::FileSystem::operator/(), DUNE::FileSystem::operator<(), DUNE::FileSystem::operator<<(), DUNE::FileSystem::operator==(), storageAvailable(), and storageCapacity().
| std::string DUNE::FileSystem::Path::suffix | ( | const Path & | path, |
| bool | keep_first_sep = false |
||
| ) | const |
References separator(), and separatorLength().
| Path::Type DUNE::FileSystem::Path::type | ( | void | ) | const |
Retrieve the path type.
References PT_DEVICE, PT_DIRECTORY, PT_FILE, PT_INVALID, and PT_LINK.
Referenced by exists(), isDevice(), isDirectory(), isFile(), and isLink().
