RTC Toolkit
2.0.0
|
This class provides a wrapper for a data point path. More...
#include <dataPointPath.hpp>
Classes | |
class | InvalidPathException |
Exception class used when an invalid character is used in a DataPointPath. More... | |
Public Member Functions | |
DataPointPath ()=default | |
DataPointPath (const DataPointPath &)=default | |
DataPointPath & | operator= (const DataPointPath &)=default |
DataPointPath (DataPointPath &&)=default | |
DataPointPath & | operator= (DataPointPath &&)=default |
virtual | ~DataPointPath ()=default |
DataPointPath (const std::string &new_path) | |
Create DataPointPath from a string. More... | |
DataPointPath (std::string &&new_path) | |
Create DataPointPath from a string. More... | |
DataPointPath (const char *const new_path) | |
Create DataPointPath from a null terminated character string. More... | |
const std::string & | ToString () const noexcept |
Get string representing the DataPointPath. More... | |
DataPointPath & | operator= (const std::string &new_path) |
Assignment operator from string. More... | |
DataPointPath & | operator= (std::string &&new_path) |
Assignment operator from string (move). More... | |
operator std::string () const noexcept | |
Cast operator to string (implicit). More... | |
DataPointPath & | operator+= (const DataPointPath &rhs) |
Append another DataPointPath to this DataPointPath without adding a path seperator, and check if appended path is still valid. More... | |
DataPointPath & | operator/= (const DataPointPath &rhs) |
Append another DataPointPath to this DataPointPath with a path seperator (/) in between if needed. More... | |
elt::mal::Uri | ToRepositoryURI (const elt::mal::Uri &base_uri) const |
Creates and returns a complete URI. More... | |
Static Public Member Functions | |
static elt::mal::Uri | AppendSuffixToUriPath (const std::string &suffix, const elt::mal::Uri &uri) |
Appends a suffix string to the path of a URI. More... | |
Friends | |
DataPointPath | operator+ (DataPointPath lhs, const DataPointPath &rhs) |
Concatenate two DataPointPaths without adding a path seperator, and checked if path is still valid. More... | |
DataPointPath | operator/ (DataPointPath lhs, const DataPointPath &rhs) |
Concatenate two DataPointPaths with a path seperator in between. More... | |
std::ostream & | operator<< (std::ostream &out, const DataPointPath &rhs) |
Output to ostream . More... | |
bool | operator== (const DataPointPath &lhs, const char *rhs) noexcept |
bool | operator!= (const DataPointPath &lhs, const char *rhs) noexcept |
bool | operator< (const DataPointPath &lhs, const char *rhs) noexcept |
bool | operator<= (const DataPointPath &lhs, const char *rhs) noexcept |
bool | operator> (const DataPointPath &lhs, const char *rhs) noexcept |
bool | operator>= (const DataPointPath &lhs, const char *rhs) noexcept |
bool | operator== (const DataPointPath &lhs, const std::string &rhs) noexcept |
bool | operator!= (const DataPointPath &lhs, const std::string &rhs) noexcept |
bool | operator< (const DataPointPath &lhs, const std::string &rhs) noexcept |
bool | operator<= (const DataPointPath &lhs, const std::string &rhs) noexcept |
bool | operator> (const DataPointPath &lhs, const std::string &rhs) noexcept |
bool | operator>= (const DataPointPath &lhs, const std::string &rhs) noexcept |
bool | operator== (const DataPointPath &lhs, const DataPointPath &rhs) noexcept |
bool | operator!= (const DataPointPath &lhs, const DataPointPath &rhs) noexcept |
bool | operator< (const DataPointPath &lhs, const DataPointPath &rhs) noexcept |
bool | operator<= (const DataPointPath &lhs, const DataPointPath &rhs) noexcept |
bool | operator> (const DataPointPath &lhs, const DataPointPath &rhs) noexcept |
bool | operator>= (const DataPointPath &lhs, const DataPointPath &rhs) noexcept |
bool | operator== (const char *lhs, const DataPointPath &rhs) noexcept |
bool | operator!= (const char *lhs, const DataPointPath &rhs) noexcept |
bool | operator< (const char *lhs, const DataPointPath &rhs) noexcept |
bool | operator<= (const char *lhs, const DataPointPath &rhs) noexcept |
bool | operator> (const char *lhs, const DataPointPath &rhs) noexcept |
bool | operator>= (const char *lhs, const DataPointPath &rhs) noexcept |
bool | operator== (const std::string &lhs, const DataPointPath &rhs) noexcept |
bool | operator!= (const std::string &lhs, const DataPointPath &rhs) noexcept |
bool | operator< (const std::string &lhs, const DataPointPath &rhs) noexcept |
bool | operator<= (const std::string &lhs, const DataPointPath &rhs) noexcept |
bool | operator> (const std::string &lhs, const DataPointPath &rhs) noexcept |
bool | operator>= (const std::string &lhs, const DataPointPath &rhs) noexcept |
std::istream & | operator>> (std::istream &input, DataPointPath &path) |
Read into DataPointPath from istream. More... | |
This class provides a wrapper for a data point path.
This ensures that the paths used to refer to specific data points only contain valid characters. Trying to use paths with invalid characters with this class will raise an exception.
An acceptable data point path contains path components separated by a single slash. Each path component can only contain lower case alphabetic characters [a-z], numeric characters [0-9] or an underscore [_]. However, a trailing underscore is not allowed and a leading numerical character is also not allowed.
The following are examples of valid data point paths:
The following are examples of invalid data point paths that will throw and exception:
|
default |
|
default |
|
default |
|
virtualdefault |
|
explicit |
Create DataPointPath from a string.
new_path | The initial path value. |
InvalidPathException | When invalid characters are found. Only a-z,0-9,_,/ are allowed, no duplicate slashes '/', and no triple underscores '_' or trailing underscores. |
|
explicit |
Create DataPointPath from a string.
new_path | The initial path value. |
InvalidPathException | When invalid characters are found. Only a-z,0-9,_,/ are allowed, no duplicate slashes '/', and no triple underscores '_' or trailing underscores. |
|
inlineexplicit |
Create DataPointPath from a null terminated character string.
new_path | The initial path value. |
InvalidPathException | When invalid characters are found. Only a-z,0-9,_,/ are allowed, no duplicate slashes '/', and no triple underscores '_' or trailing underscores. |
|
static |
Appends a suffix string to the path of a URI.
This function concatenates a suffix string, interpreted as a path, to the given URI's path. However, this is done taking the leading and trailing slash characters into account, i.e. it makes sure that the path separator character '/' is only introduced once between the path from the input URI and the suffix string. In addition, if the original URI contains an empty path then the suffix is appended as is, allowing construction of URI's with relative paths.
suffix | The suffix string to append to uri. |
uri | The URI to which the suffix will be appended. |
|
inlinenoexcept |
Cast operator to string (implicit).
This cast operator allows using DataPointPath in places where std::string
is needed. It will just return the internal string.
|
inline |
Append another DataPointPath to this DataPointPath without adding a path seperator, and check if appended path is still valid.
InvalidPathException | When invalid characters are found. Only a-z,0-9,_,/ are allowed, no duplicate slashes '/', and no triple underscores '_' or trailing underscores. |
rhs | Right hand side operand. |
|
inline |
Append another DataPointPath to this DataPointPath with a path seperator (/) in between if needed.
rhs | Right hand side operand. |
|
default |
DataPointPath & rtctk::componentFramework::DataPointPath::operator= | ( | const std::string & | new_path | ) |
Assignment operator from string.
new_path | The new path string to use. |
InvalidPathException | When invalid characters are found. Only a-z,0-9,_,/ are allowed, no duplicate slashes '/', and no triple underscores '_' or trailing underscores. |
|
default |
DataPointPath & rtctk::componentFramework::DataPointPath::operator= | ( | std::string && | new_path | ) |
Assignment operator from string (move).
new_path | The new path string to use. |
InvalidPathException | When invalid characters are found. Only a-z,0-9,_,/ are allowed, no duplicate slashes '/', and no triple underscores '_' or trailing underscores. |
elt::mal::Uri rtctk::componentFramework::DataPointPath::ToRepositoryURI | ( | const elt::mal::Uri & | base_uri | ) | const |
Creates and returns a complete URI.
This function generates a Uri object given a base uri. The path is appended to base_uri
and the complete URI is returned. It takes care that no double slashes, are3 created in URI. E.g. check for if curent URI ends with a slash, and path starts with a slash.
base_uri | The base URI prefix that is to be added as a prefix. |
|
inlinenoexcept |
Get string representing the DataPointPath.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
Concatenate two DataPointPaths without adding a path seperator, and checked if path is still valid.
InvalidPathException | When invalid characters are found. Only a-z,0-9,_,/ are allowed, no duplicate slashes '/', and no triple underscores '_' or trailing underscores. |
lhs | Left hand side operand. |
rhs | Right hand side operand. |
|
friend |
Concatenate two DataPointPaths with a path seperator in between.
lhs | Left hand side operand. |
rhs | Right hand side operand. |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
Output to ostream
.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
Read into DataPointPath from istream.