Kea 2.7.5
|
Paths on a filesystem. More...
#include <filesystem.h>
Public Member Functions | |
Path (std::string const &path) | |
Constructor. | |
std::string | extension () const |
Get the extension of the file. | |
std::string | filename () const |
Get the name of the file, extension included. | |
std::string | parentPath () const |
Get the parent path. | |
Path & | replaceExtension (std::string const &replacement=std::string()) |
Identifies the extension in {replacement}, trims it, and replaces this instance's extension with it. | |
Path & | replaceParentPath (std::string const &replacement=std::string()) |
Trims {replacement} and replaces this instance's parent path with it. | |
std::string | stem () const |
Get the base name of the file without the extension. | |
std::string | str () const |
Get the path in textual format. | |
Paths on a filesystem.
Definition at line 73 of file filesystem.h.
isc::util::file::Path::Path | ( | std::string const & | path | ) |
string isc::util::file::Path::extension | ( | ) | const |
Get the extension of the file.
Counterpart for std::filesystem::path::extension.
Definition at line 143 of file filesystem.cc.
Referenced by sentinel().
string isc::util::file::Path::filename | ( | ) | const |
Get the name of the file, extension included.
Counterpart for std::filesystem::path::filename.
Definition at line 148 of file filesystem.cc.
string isc::util::file::Path::parentPath | ( | ) | const |
Get the parent path.
Counterpart for std::filesystem::path::parent_path.
Definition at line 133 of file filesystem.cc.
Path & isc::util::file::Path::replaceExtension | ( | std::string const & | replacement = std::string() | ) |
Identifies the extension in {replacement}, trims it, and replaces this instance's extension with it.
Counterpart for std::filesystem::path::replace_extension.
The change is done in the members and {this} is returned to allow call chaining.
replacement | The extension to replace with. |
Definition at line 153 of file filesystem.cc.
References isc::util::str::trim().
Path & isc::util::file::Path::replaceParentPath | ( | std::string const & | replacement = std::string() | ) |
Trims {replacement} and replaces this instance's parent path with it.
The change is done in the members and {this} is returned to allow call chaining.
replacement | The parent path to replace with. |
Definition at line 169 of file filesystem.cc.
References isc::util::str::trim().
string isc::util::file::Path::stem | ( | ) | const |
Get the base name of the file without the extension.
Counterpart for std::filesystem::path::stem.
Definition at line 138 of file filesystem.cc.
Referenced by isc::process::Daemon::checkConfigFile(), isc::process::Daemon::makePIDFileName(), and sentinel().
string isc::util::file::Path::str | ( | ) | const |
Get the path in textual format.
Counterpart for std::filesystem::path::string.
Definition at line 128 of file filesystem.cc.