edelib
2.0.0
|
Represents D-Bus object path. More...
#include <edelib/EdbusObjectPath.h>
Public Member Functions | |
EdbusObjectPath () | |
EdbusObjectPath (const char *str) | |
EdbusObjectPath (const EdbusObjectPath &) | |
~EdbusObjectPath () | |
void | append (const char *str) |
void | clear (void) |
const char * | path (void) const |
bool | operator== (const EdbusObjectPath &other) |
bool | operator!= (const EdbusObjectPath &other) |
Static Public Member Functions | |
static bool | valid_element (const char *str) |
static bool | valid_path (const char *str) |
static bool | valid_path (const EdbusObjectPath &path) |
Represents D-Bus object path.
This data type is necessary to correctly represents D-Bus object path since D-Bus protocol limits character range that should be in object path name. Also, D-Bus have different signature for object paths than for ordinary strings.
Valid path is that string that contains elements with [A-Z][a-z][0-9]_ characters, separated by // character. The path must begin with //, and must not ends with it (except path contains only root). E.g.
Valid paths: / /org/foo/baz Invalid paths: // /org/foo/baz/ /org//foo/baz ...
This class will always construct valid path, so if parameter with invalid character range is given, it will ignore it.
EdbusObjectPath | ( | ) |
Construct root-ed path(//)
EdbusObjectPath | ( | const char * | str | ) |
Use str as path. If str is not valid path, EdbusObjectPath will ignore it, constructing only root-ed path
str | is string that should be valid path |
EdbusObjectPath | ( | const EdbusObjectPath & | ) |
Copy path from other EdbusObjectPath object
~EdbusObjectPath | ( | ) |
Clears data
void append | ( | const char * | str | ) |
Appends str to the path. str should be path element (allowed characters without // character. If str is not valid element (you can validate it with valid_element() function, this function will ignore it).
str | is path element |
Referenced by edelib::operator<<().
void clear | ( | void | ) |
Clears data and construct root-ed path.
bool operator!= | ( | const EdbusObjectPath & | other | ) | [inline] |
Validate if two paths are not equal
bool operator== | ( | const EdbusObjectPath & | other | ) | [inline] |
Validate if two paths are equal
const char* path | ( | void | ) | const [inline] |
Returns object path
Referenced by EdbusObjectPath::valid_path().
static bool valid_element | ( | const char * | str | ) | [static] |
Check if element is valid and can be used in path construction
str | is path element |
static bool valid_path | ( | const char * | str | ) | [static] |
Check if str is valid path
str | is full object path |
static bool valid_path | ( | const EdbusObjectPath & | path | ) | [inline, static] |
Check if EdbusObjectPath object contains valid path. This function should always return true on fully constructed object.
path | is EdbusObjectPath object |
References EdbusObjectPath::path(), and EdbusObjectPath::valid_path().
Referenced by EdbusObjectPath::valid_path().