|
|
| path (std::string const &path) |
| | Explicitly construct a path from a string.
|
| |
|
path & | operator= (std::string const &str) |
| | Assign from a string.
|
| |
|
bool | operator== (path const &other) const |
| | Equality.
|
| |
|
bool | operator!= (path const &other) const |
| | Inequality.
|
| |
|
bool | operator< (path const &other) const |
| | Less-than operator.
|
| |
| size_t | elements () const |
| | Get the number of elements in the path More...
|
| |
|
std::string const & | str () const |
| | Get the path as a string.
|
| |
|
size_t | length () const |
| | Get the length of the path.
|
| |
| std::string | element (size_t which) const |
| | Return a path element by index. More...
|
| |
|
std::string | cur_element () const |
| | Get the path element at the cursor.
|
| |
|
std::string | operator[] (size_t which) const |
| | The subscript operator is equivalent to element(which)
|
| |
| bool | is_prefix_of (path const &other) const |
| | Say whether the path consists of an initial subsequence of the elements of another. More...
|
| |
| std::string | segment (size_t start=0, size_t len=std::string::npos) const |
| | Get a sub-sequence of the path's elements as a string. More...
|
| |
| void | push_back (std::string const &str) |
| | Append a string to the path. More...
|
| |
|
void | pop_back () |
| | Remove the last element of the path, if any.
|
| |
| void | push_front (std::string const &str) |
| | Prepend a string to the path. More...
|
| |
|
void | pop_front () |
| | Remove the first element of the path, if any.
|
| |
| path | operator+ (std::string const &str) const |
| | Get the concatenation of the path with a string. More...
|
| |
| path | operator+ (path const &rhs) const |
| | Get the concatenation of the path with another. More...
|
| |
|
path & | operator+= (std::string const &str) |
| | operator+=(str) is equivalent to push_back(str)
|
| |
|
path & | operator+= (path const &rhs) |
| | operator+=(path) is equivalent to push_back(path.str())
|
| |
| void | insert (size_t after, std::string const &str) |
| | Insert a string into the path. More...
|
| |
| void | cut (size_t start=0, size_t len=std::string::npos) |
| | Remove a segment from the path. More...
|
| |
| void | rectify () |
| | Correct anomalies in the path. More...
|
| |
| int | to_end () |
| | Set the cursor to index the final element, or to 0 if the path is empty. More...
|
| |
|
| int & | posn () |
| | Get a [const] reference to the path's cursor. More...
|
| |
|
int const & | posn () const |
| |
template<char Delim>
struct path< Delim >
Encapsulates a filesystem path.
struct path controls a string representing an absolute or relative pathname and provides queries and operations on it.
A path contains a cursor that can be used to maintain and modify an index into the elements of the path.
- Template Parameters
-
| Delim | The character that delimits elements of a path. |
Definition at line 59 of file path.h.
template<char Delim>
| int& path< Delim >::posn |
( |
| ) |
|
|
inline |
Get a [const] reference to the path's cursor.
- Returns
- A [const] reference to the cursor.
The cursor can be used to maintain and modify an index into the path's elements.
No operation on a path except assignment modifies its cursor, even if the operation leaves the cursor out of range.
Definition at line 333 of file path.h.