Basic class storing paths made of string elements. More...
#include <eagine/string_path.hpp>
Public Types | |
| using | value_type = string_view |
| The element value type. | |
| using | size_type = span_size_t |
| The element count type. | |
| using | iterator = string_list::iterator< const char * > |
| Iterator type. | |
| using | reverse_iterator = string_list::rev_iterator< const char * > |
| Reverse iterator type. | |
Public Member Functions | |
| basic_string_path () noexcept=default | |
| Default constructor. Creates an empty path. More... | |
| basic_string_path (basic_string_path &&) noexcept=default | |
| Move constructor. | |
| basic_string_path (const basic_string_path &)=default | |
| Copy constructor. | |
| auto | operator= (basic_string_path &&) noexcept -> basic_string_path &=default |
| Move assignment operator. | |
| auto | operator= (const basic_string_path &) -> basic_string_path &=default |
| Copy assignment operator. | |
| basic_string_path (string_view path, EAGINE_TAG_TYPE(split_by), string_view sep) | |
| Construction from a path string and a separator string. | |
| basic_string_path (span< const string_view > names) | |
| Construction from a list of path element names. | |
| template<std::size_t N> | |
| basic_string_path (const std::array< string_view, N > &names) | |
| Construction from a list of path element names. | |
| template<typename... Str> | |
| basic_string_path (EAGINE_TAG_TYPE(from_pack), string_view name, const Str &... names) | |
| Construction from a pack of path element names. | |
| auto | empty () const noexcept -> bool |
| Indicates if this path is empty. More... | |
| void | clear () noexcept |
| Clears this path. More... | |
| auto | size () const noexcept -> size_type |
| Returns the number of elements in this path. More... | |
| void | reserve_bytes (size_type s) |
| Reserves the specified number of bytes in the storage. | |
| auto | front () const noexcept -> string_view |
| Returns the element at the front of the path. | |
| auto | back () const noexcept -> string_view |
| Returns the element at the back of the path. | |
| void | push_back (string_view name) |
| Appends a new element with the specified name to the end. More... | |
| void | pop_back () |
| Removes a single element from the end of this path. More... | |
| auto | begin () const noexcept -> iterator |
| Returns an iterator pointing to the start of the path. More... | |
| auto | end () const noexcept -> iterator |
| Returns an iterator pointing past the end of the path. More... | |
| auto | rbegin () const noexcept -> reverse_iterator |
| Returns a reverse iterator pointing to the end of the path. More... | |
| auto | rend () const noexcept -> reverse_iterator |
| Returns an iterator pointing past the start of the path. More... | |
| template<typename Func > | |
| void | for_each_elem (Func func) const |
| Calls the specified function for each element of this path. | |
| template<typename Func > | |
| void | rev_for_each_elem (Func func) const |
| Calls the specified function for each element in reverse order. | |
| auto | as_string (string_view sep, bool trail_sep) const -> std::string |
Returns this path as string with elements separated by sep. | |
| auto | block () noexcept -> memory::const_block |
| Returns a block covering the internal representation of this path. | |
Friends | |
| auto | operator== (const basic_string_path &a, const basic_string_path &b) noexcept |
| Equality comparison. | |
| auto | operator!= (const basic_string_path &a, const basic_string_path &b) noexcept |
| Non-equality comparison. | |
| auto | operator< (const basic_string_path &a, const basic_string_path &b) noexcept |
| Less-than comparison. | |
| auto | operator<= (const basic_string_path &a, const basic_string_path &b) noexcept |
| Less-equal comparison. | |
| auto | operator> (const basic_string_path &a, const basic_string_path &b) noexcept |
| Greater-than comparison. | |
| auto | operator>= (const basic_string_path &a, const basic_string_path &b) noexcept |
| Greater-equal comparison. | |
| auto | operator+ (const basic_string_path &a, const basic_string_path &b) noexcept |
| Concatenates two paths. | |
Basic class storing paths made of string elements.
Efficiently stores a sequence of string elements in a single block of memory.
|
defaultnoexcept |
Default constructor. Creates an empty path.
|
inlinenoexcept |
|
inlinenoexcept |
Clears this path.
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Removes a single element from the end of this path.
|
inline |
Appends a new element with the specified name to the end.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |