Drop-in replacement for std::filesystem::path.
More...
#include <filesystem_helper.hpp>
Drop-in replacement for std::filesystem::path.
It must conform to the same standard described and cannot include methods that are not incorporated there.
◆ path() [1/3]
rcpputils::fs::path::path |
( |
| ) |
|
|
default |
Constructs an empty path.
◆ path() [2/3]
Conversion constructor from a std::string path.
- Parameters
-
p | A string path split by the platform's string path separator. |
◆ path() [3/3]
rcpputils::fs::path::path |
( |
const path & |
p | ) |
|
|
default |
◆ string()
Get the path delimited using this system's path separator.
- Returns
- The path as a string
◆ exists()
bool rcpputils::fs::path::exists |
( |
| ) |
const |
Check if this path exists.
- Returns
- True if the path exists, false otherwise.
◆ is_directory()
bool rcpputils::fs::path::is_directory |
( |
| ) |
const |
|
noexcept |
Check if the path exists and it is a directory.
- Returns
- True if the path is an existing directory, false otherwise.
◆ is_regular_file()
bool rcpputils::fs::path::is_regular_file |
( |
| ) |
const |
|
noexcept |
Check if the path is a regular file.
- Returns
- True if the file is an existing regular file, false otherwise.
◆ file_size()
uint64_t rcpputils::fs::path::file_size |
( |
| ) |
const |
Return the size of the file in bytes.
- Returns
- size of file in bytes
- Exceptions
-
◆ empty()
bool rcpputils::fs::path::empty |
( |
| ) |
const |
Check if the path is empty.
- Returns
- True if the path is empty, false otherwise.
◆ is_absolute()
bool rcpputils::fs::path::is_absolute |
( |
| ) |
const |
Check if the path is an absolute path.
- Returns
- True if the path is absolute, false otherwise.
◆ cbegin()
Const iterator to first element of this path.
- Returns
- A const iterator to the first element.
◆ cend()
Const iterator to one past the last element of this path.
return A const iterator to one past the last element of the path.
◆ parent_path()
path rcpputils::fs::path::parent_path |
( |
| ) |
const |
Get the parent directory of this path.
- Returns
- A path to the parent directory.
◆ filename()
path rcpputils::fs::path::filename |
( |
| ) |
const |
Get the last element in this path.
If this path points to a directory, it will return the directory name.
- Returns
- The last element in this path
◆ extension()
path rcpputils::fs::path::extension |
( |
| ) |
const |
Get a relative path to the component including and following the last '.'.
- Returns
- The string extension
◆ operator/() [1/2]
Concatenate a path and a string into a single path.
- Parameters
-
other | the string compnoent to concatenate |
- Returns
- The combined path of this and other.
◆ operator/=() [1/2]
Append a string component to this path.
- Parameters
-
other | the string component to append |
- Returns
- *this
◆ operator/() [2/2]
path rcpputils::fs::path::operator/ |
( |
const path & |
other | ) |
const |
Concatenate two paths together.
- Parameters
-
- Returns
- The combined path.
◆ operator/=() [2/2]
path& rcpputils::fs::path::operator/= |
( |
const path & |
other | ) |
|
Append a string component to this path.
- Parameters
-
other | the string component to append |
- Returns
- *this
The documentation for this class was generated from the following file: