Diagram path. More...
Diagram path.
This class stores a diagram path, such as a namespace or directory structure.
#include <path.h>
Public Types | |
using | container_type = std::vector< std::string > |
Public Member Functions | |
path (path_type pt=path_type::kNamespace) | |
path (const std::string &ns, path_type pt=path_type::kNamespace) | |
virtual | ~path ()=default |
path (container_type::const_iterator begin, container_type::const_iterator end, path_type pt=path_type::kNamespace) | |
path (const path &right)=default | |
path & | operator= (const path &right) |
path (path &&right) noexcept=default | |
path & | operator= (path &&right) noexcept=default |
path (std::initializer_list< std::string > ns, path_type pt=path_type::kNamespace) | |
path (const std::vector< std::string > &ns, path_type pt=path_type::kNamespace) | |
std::string | to_string () const |
bool | is_empty () const |
bool | is_root () const |
void | is_root (bool r) |
size_t | size () const |
path | operator| (const path &right) const |
void | operator|= (const path &right) |
path | operator| (const std::string &right) const |
void | operator|= (const std::string &right) |
std::string & | operator[] (const unsigned int index) |
const std::string & | operator[] (const unsigned int index) const |
void | append (const std::string &name) |
void | append (const path &ns) |
void | pop_back () |
std::optional< path > | parent () const |
bool | starts_with (const path &prefix) const |
bool | ends_with (const path &suffix) const |
path | common_path (const path &right) const |
Returns the common prefix of 2 paths. | |
path | relative_to (const path &right) const |
std::string | relative (const std::string &ns) const |
std::string | name () const |
path::container_type::iterator | begin () |
path::container_type::iterator | end () |
path::container_type::const_iterator | cbegin () const |
path::container_type::const_iterator | cend () const |
path::container_type::const_iterator | begin () const |
path::container_type::const_iterator | end () const |
path_type | type () const |
const container_type & | tokens () const |
Static Public Member Functions | |
static container_type | split (const std::string &ns, path_type pt=path_type::kNamespace) |
Private Member Functions | |
const char * | separator () const |
Static Private Member Functions | |
static const char * | separator (path_type pt) |
Private Attributes | |
path_type | path_type_ |
container_type | path_ |
bool | is_root_ {false} |
Friends | |
bool | operator== (const path &left, const path &right) |
bool | operator< (const path &left, const path &right) |
using clanguml::common::model::path::container_type = std::vector<std::string> |
|
inline |
|
inline |
|
virtualdefault |
|
inline |
|
default |
|
defaultnoexcept |
|
inline |
Definition at line 153 of file path.h.
|
inlineexplicit |
Definition at line 167 of file path.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns the common prefix of 2 paths.
If no common prefix exists between 2 paths, the result is an empty path.
right | Path to compare |
|
inline |
|
inline |
|
inline |
Returns true if path ends with suffix
suffix | Path suffix to check |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Make path represented as a string relative to the current path.
ns | Path to make relative against *this. |
Definition at line 391 of file path.h.
Make the current path relative to the other path, if possible.
If not, return the original path.
right | Parent path |
right
Definition at line 372 of file path.h.
|
inlineprivate |
|
inlinestaticprivate |
|
inline |
|
inlinestatic |
Definition at line 83 of file path.h.
|
inline |
Returns true if path starts with specified prefix.
prefix | Path prefix to check. |
|
inline |
|
inline |
|
inline |
|
private |