#include <Path.hpp>
Public Member Functions | |
| Path () | |
| Construct an uninitialzed path, because the STL is annoying. | |
| Path (const std::basic_string< char > &path) | |
| Construct a Path from an std::string. | |
| Path (const char *cpath) | |
| Construct a Path from a C string. | |
| bool | is_child_of (const Path &parent) const |
| bool | is_parent_of (const Path &child) const |
| Symbol | name () const |
| Return the name of this object (everything after the last '/'). | |
| Path | parent () const |
| Return the parent's path. | |
| Path | relative_to_base (const Path &base) const |
| Return path relative to soe base path (chop prefix). | |
| const std::string | base () const |
| Return path with a trailing "/". | |
Static Public Member Functions | |
| static bool | is_valid (const std::basic_string< char > &path) |
| static bool | is_valid_name (const std::basic_string< char > &name) |
| static std::string | pathify (const std::basic_string< char > &str) |
| static std::string | nameify (const std::basic_string< char > &str) |
| static void | replace_invalid_chars (std::string &str, bool replace_slash=false) |
| static bool | descendant_comparator (const Path &parent, const Path &child) |
| Return true if child is equal to, or a descendant of parent. | |
This enforces that a Path is a valid OSC path (though it is used for GraphObject paths, which aren't directly OSC paths but a portion of one).
A path is divided by slashes (/). The first character MUST be a slash, and the last character MUST NOT be a slash (except in the special case of the root path "/", which is the only valid single-character path).
Valid characters are the 95 printable ASCII characters (32-126), excluding: space # * , ? [ ] { }
| Raul::Path::Path | ( | ) | [inline] |
Construct an uninitialzed path, because the STL is annoying.
| Raul::Path::Path | ( | const std::basic_string< char > & | path | ) | [inline] |
| Raul::Path::Path | ( | const char * | cpath | ) | [inline] |
| Symbol Raul::Path::name | ( | ) | const [inline] |
Return the name of this object (everything after the last '/').
This is the "method name" for OSC paths.
| Path Raul::Path::parent | ( | ) | const [inline] |
Return the parent's path.
Calling this on the path "/" will return "/". This is the (deepest) "container path" for OSC paths.
| const std::string Raul::Path::base | ( | ) | const [inline] |
Return path with a trailing "/".
Returned value is guaranteed to be a valid parent path, i.e. a valid child path can be made using parent.base() + child_name.
1.5.5