|
LibSWOC++ 1.5.14
Solid Wall of C++
|
#include <swoc_file.h>

Public Member Functions | |
| path ()=default | |
| Default construct empty path. | |
| path (const self_type &that)=default | |
| Copy constructor - copies the path. | |
| path (self_type &&that)=default | |
| Move constructor. | |
| path (const char *src) | |
| Construct from a null terminated string. | |
| path (std::string_view src) | |
| Construct from a string view. | |
| path (std::string const &p) | |
| Construct with a copy of p. | |
| path (std::string &&that) | |
| Move from an existing string. | |
| self_type & | operator= (const self_type &that)=default |
| Replace the path with a copy of that. | |
| self_type & | operator= (self_type &&that)=default |
| Replace the path with the contents of that. | |
| self_type & | operator= (std::string_view p) |
| Assign p as the path. | |
| self_type & | operator= (std::string const &s) |
| Assign s as the path. | |
| self_type & | operator= (std::string &&s) |
| Move s to be the path. | |
| self_type & | operator= (char const *s) |
| Copy s as the path. | |
| self_type & | operator/= (const self_type &that) |
| self_type & | operator/= (std::string_view that) |
| bool | empty () const |
| Check if the path is empty. | |
| bool | is_absolute () const |
| Check if the path is absolute. | |
| bool | is_relative () const |
| Check if the path is not absolute. | |
| self_type | parent_path () const |
| Path of the parent. | |
| self_type | relative_path () const |
| self_type | filename () const |
| char const * | c_str () const |
| Access the path explicitly. | |
| std::string const & | string () const |
| The path as a string. | |
| self_type & | reserve (size_t n) |
| swoc::TextView | view () const |
| A view of the path. | |
Static Public Attributes | |
| static constexpr char | SEPARATOR = '/' |
| Default path separator. | |
Protected Attributes | |
| std::string | _path |
| File path. | |
Utility class for file system paths.
Definition at line 93 of file swoc_file.h.
|
inlineexplicit |
Construct from a null terminated string.
Definition at line 366 of file swoc_file.h.
|
inline |
Construct from a string view.
Definition at line 368 of file swoc_file.h.
|
inline |
Construct with a copy of p.
Definition at line 370 of file swoc_file.h.
|
inline |
Move from an existing string.
Definition at line 372 of file swoc_file.h.
|
inline |
Access the path explicitly.
Definition at line 399 of file swoc_file.h.
|
inline |
Check if the path is empty.
Definition at line 414 of file swoc_file.h.
| auto swoc::file::path::filename | ( | ) | const |
|
inline |
Check if the path is absolute.
Definition at line 419 of file swoc_file.h.
|
inline |
Check if the path is not absolute.
Definition at line 424 of file swoc_file.h.
Append or replace path with that.
If that is absolute, it replaces this. Otherwise that is appended with exactly one separator.
| that | Filesystem path. |
Definition at line 429 of file swoc_file.h.
| path & swoc::file::path::operator/= | ( | std::string_view | that | ) |
Append or replace path with that.
If that is absolute, it replaces this. Otherwise that is appended with exactly one separator.
| that | Filesystem path. |
Definition at line 44 of file swoc_file.cc.
|
inline |
Copy s as the path.
Definition at line 393 of file swoc_file.h.
|
inline |
Move s to be the path.
Definition at line 387 of file swoc_file.h.
|
inline |
Assign s as the path.
Definition at line 381 of file swoc_file.h.
|
inline |
Assign p as the path.
Definition at line 375 of file swoc_file.h.
| path swoc::file::path::parent_path | ( | ) | const |
Path of the parent.
Definition at line 23 of file swoc_file.cc.
| path swoc::file::path::relative_path | ( | ) | const |
Definition at line 30 of file swoc_file.cc.
|
inline |
Reserve space in the path.
| n | Number of bytes to reserve. |
Definition at line 479 of file swoc_file.h.
|
inline |
The path as a string.
Definition at line 404 of file swoc_file.h.
|
inline |
A view of the path.
Definition at line 409 of file swoc_file.h.
|
protected |
File path.
Definition at line 198 of file swoc_file.h.
|
staticconstexpr |
Default path separator.
Definition at line 98 of file swoc_file.h.