![]() |
dbus-cxx
|
Represents a DBus Path. More...
#include <path.h>
Inherits std::string.
Public Member Functions | |
Path () | |
Path (const std::string &s, size_type pos=0, size_type n=npos) | |
Path (const char *) | |
Path (const char *s, size_type n) | |
Path (size_type n, char c) | |
template<class InputIterator > | |
Path (InputIterator first, InputIterator last) | |
~Path () | |
operator bool () const | |
bool | is_valid () const |
bool | is_root () const |
std::vector< std::string > | decomposed () const |
Decomposes the string into its component elements. More... | |
bool | append_element (const std::string &element) |
Adds the element string to the path ensuring delimeters are properly taken care of. More... | |
Static Public Member Functions | |
static Path | relative_path (const Path &first, const Path &second) |
Create a relative path between the two paths. More... | |
DBus::Path::Path | ( | ) |
DBus::Path::Path | ( | const std::string & | s, |
size_type | pos = 0 , |
||
size_type | n = npos |
||
) |
DBus::Path::Path | ( | const char * | s | ) |
DBus::Path::Path | ( | const char * | s, |
size_type | n | ||
) |
DBus::Path::Path | ( | size_type | n, |
char | c | ||
) |
|
inline |
DBus::Path::~Path | ( | ) |
bool DBus::Path::append_element | ( | const std::string & | element | ) |
Adds the element string to the path ensuring delimeters are properly taken care of.
An element that contains invalid characters will not be added to the path.
References DBUSCXX_VALID_PATH_CHARACTERS, and DBus::npos.
Referenced by relative_path().
std::vector< std::string > DBus::Path::decomposed | ( | ) | const |
Decomposes the string into its component elements.
If the path is invalid or non-existant an empty vector will be returned.
If the path is the root path a vector containing a single empty string will be returned. In this way a valid root path is differentiated from an invalid or empty path.
References decomposed(), and is_valid().
Referenced by decomposed(), DBus::Connection::process_call_message(), relative_path(), and DBus::Connection::unregister_object().
bool DBus::Path::is_root | ( | ) | const |
Referenced by DBus::Connection::process_call_message(), relative_path(), and DBus::Connection::unregister_object().
bool DBus::Path::is_valid | ( | ) | const |
References DBUSCXX_VALID_PATH_CHARACTERS, and DBus::npos.
Referenced by decomposed().
DBus::Path::operator bool | ( | ) | const |
Create a relative path between the two paths.
The second param must be below the first, e.g. if first is "/first" and second is "/second" this returns a null path.
first | |
second |
References append_element(), decomposed(), and is_root().