ChimeraTK-DeviceAccess
03.18.00
|
Class to store a register path name. More...
#include <RegisterPath.h>
Public Member Functions | |
RegisterPath () | |
RegisterPath (const std::string &_path) | |
RegisterPath (const RegisterPath &_path) | |
RegisterPath & | operator= (const RegisterPath &_path)=default |
RegisterPath (const char *_path) | |
operator std::string () const | |
type conversion operators into std::string More... | |
void | setAltSeparator (const std::string &altSeparator) |
set alternative separator. More... | |
std::string | getWithAltSeparator () const |
obtain path with alternative separator character instead of "/". More... | |
RegisterPath & | operator/= (const std::string &rightHandSide) |
/= operator: modify this object by adding a new element to this path More... | |
RegisterPath & | operator+= (const std::string &rightHandSide) |
+= operator: just concatenate-assign like normal strings More... | |
bool | operator< (const RegisterPath &rightHandSide) const |
< operator: comparison used for sorting e.g. in std::map More... | |
RegisterPath & | operator-- (int) |
Cut-right operator, e.g. registerPath– . More... | |
RegisterPath & | operator-- () |
Cut-left operator, e.g. –registerPath . More... | |
bool | operator== (const RegisterPath &rightHandSide) const |
comparison with other RegisterPath More... | |
bool | operator== (const std::string &rightHandSide) const |
comparison with std::string More... | |
bool | operator== (const char *rightHandSide) const |
comparison with char* More... | |
bool | operator!= (const RegisterPath &rightHandSide) const |
comparison with other RegisterPath More... | |
bool | operator!= (const std::string &rightHandSide) const |
comparison with std::string More... | |
bool | operator!= (const char *rightHandSide) const |
comparison with char* More... | |
size_t | length () const |
return the length of the path (including leading slash) More... | |
bool | startsWith (const RegisterPath &compare) const |
check if the register path starts with the given path More... | |
bool | endsWith (const RegisterPath &compare) const |
check if the register path ends with the given path component(s) More... | |
std::vector< std::string > | getComponents () const |
split path into components More... | |
Protected Member Functions | |
void | removeExtraSeparators () |
Search for duplicate separators (e.g. More... | |
std::string | getWithOtherSeparatorReplaced (const std::string &otherSeparator) const |
Return the path after replacing the given otherSeparator with the standard separator "/". More... | |
std::string | getCommonAltSeparator (const RegisterPath &otherPath) const |
return common alternative separator for this RegisterPath and the specified other RegisterPath objects. More... | |
Static Protected Member Functions | |
static std::string | removeExtraSeparators (std::string string, const std::string &sep=separator) |
Search for duplicate separators (e.g. More... | |
Protected Attributes | |
std::string | path |
path in standardised notation More... | |
std::string | separator_alt |
altenative separator character More... | |
Static Protected Attributes | |
static const char | separator [] = "/" |
separator character to separate the elements in the path More... | |
Friends | |
RegisterPath | operator/ (const RegisterPath &leftHandSide, const RegisterPath &rightHandSide) |
non-member / operator: add a new element to the path. More... | |
RegisterPath | operator+ (const RegisterPath &leftHandSide, const std::string &rightHandSide) |
RegisterPath | operator/ (const RegisterPath &leftHandSide, int rightHandSide) |
operators used to build numeric addresses from integers More... | |
RegisterPath | operator* (const RegisterPath &leftHandSide, int rightHandSide) |
std::ostream & | operator<< (std::ostream &os, const RegisterPath &me) |
streaming operator More... | |
Class to store a register path name.
Elements of the path are separated by a "/" character, but an alternative separation character (e.g. ".") can optionally be specified as well. Different equivalent notations will be converted into a standardised notation automatically.
Definition at line 16 of file RegisterPath.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
check if the register path ends with the given path component(s)
Definition at line 149 of file RegisterPath.h.
|
inlineprotected |
return common alternative separator for this RegisterPath and the specified other RegisterPath objects.
Definition at line 224 of file RegisterPath.h.
|
inline |
split path into components
Definition at line 158 of file RegisterPath.h.
|
inline |
obtain path with alternative separator character instead of "/".
The leading separator will be omitted
Definition at line 48 of file RegisterPath.h.
|
inlineprotected |
Return the path after replacing the given otherSeparator with the standard separator "/".
Definition at line 208 of file RegisterPath.h.
|
inline |
return the length of the path (including leading slash)
Definition at line 138 of file RegisterPath.h.
|
inline |
type conversion operators into std::string
Definition at line 34 of file RegisterPath.h.
|
inline |
comparison with char*
Definition at line 135 of file RegisterPath.h.
|
inline |
comparison with other RegisterPath
Definition at line 129 of file RegisterPath.h.
|
inline |
comparison with std::string
Definition at line 132 of file RegisterPath.h.
|
inline |
+= operator: just concatenate-assign like normal strings
Definition at line 66 of file RegisterPath.h.
|
inline |
Cut-left operator, e.g. –registerPath
.
Remove the first element form the path and return the modified path.
Definition at line 102 of file RegisterPath.h.
|
inline |
Cut-right operator, e.g. registerPath–
.
Remove the last element from the path and return the modified path.
xx–
operator on numeric types this is NOT a post operator! It returns the already modified register path. Definition at line 84 of file RegisterPath.h.
|
inline |
/= operator: modify this object by adding a new element to this path
Definition at line 59 of file RegisterPath.h.
|
inline |
< operator: comparison used for sorting e.g. in std::map
Definition at line 73 of file RegisterPath.h.
|
default |
|
inline |
comparison with char*
Definition at line 126 of file RegisterPath.h.
|
inline |
comparison with other RegisterPath
Definition at line 117 of file RegisterPath.h.
|
inline |
comparison with std::string
Definition at line 123 of file RegisterPath.h.
|
inlineprotected |
Search for duplicate separators (e.g.
"//") and remove one of them. Also removes a trailing separator, if present.
Definition at line 192 of file RegisterPath.h.
|
inlinestaticprotected |
Search for duplicate separators (e.g.
"//") and remove one of them. Also removes a trailing separator, if present. The second optional argument allows to search for other separators instead of the default.
Definition at line 197 of file RegisterPath.h.
|
inline |
set alternative separator.
Definition at line 37 of file RegisterPath.h.
|
inline |
check if the register path starts with the given path
Definition at line 141 of file RegisterPath.h.
|
friend |
Definition at line 47 of file RegisterPath.cc.
|
friend |
Definition at line 32 of file RegisterPath.cc.
|
friend |
non-member / operator: add a new element to the path.
Must be a non-member operator to allow implicit type conversions also on the leftHandSide.
Definition at line 15 of file RegisterPath.cc.
|
friend |
operators used to build numeric addresses from integers
Definition at line 41 of file RegisterPath.cc.
|
friend |
streaming operator
Definition at line 56 of file RegisterPath.cc.
|
protected |
path in standardised notation
Definition at line 182 of file RegisterPath.h.
|
staticprotected |
separator character to separate the elements in the path
Definition at line 185 of file RegisterPath.h.
|
protected |
altenative separator character
Definition at line 188 of file RegisterPath.h.