Go to the documentation of this file.
12 #ifndef RTCTK_COMPONENTFRAMEWORK_DATAPOINTPATH_HPP
13 #define RTCTK_COMPONENTFRAMEWORK_DATAPOINTPATH_HPP
20 #include <string_view>
21 #include <type_traits>
23 #include <mal/utility/Uri.hpp>
72 using elt::error::CiiBaseException::CiiBaseException;
111 const std::string&
ToString() const noexcept;
135 operator
std::
string() const noexcept;
188 friend
bool operator==(const
DataPointPath& lhs, const
char* rhs) noexcept;
189 friend
bool operator!=(const
DataPointPath& lhs, const
char* rhs) noexcept {
190 return !(lhs == rhs);
199 return !(lhs == rhs);
208 return !(lhs == rhs);
220 return !(rhs == lhs);
239 return !(rhs == lhs);
291 static bool ValidPath(
const std::string& path);
296 const static char VALID_CHARACTERS[];
299 const static std::regex REGEX_VALID_CHARS;
302 DataPointPath
operator"" _dppath(
const char* str, std::size_t len);
307 return lhs.path == rhs;
311 return lhs.path < rhs;
315 return lhs.path <= rhs;
319 return lhs.path > rhs;
323 return lhs.path >= rhs;
327 return lhs.path == rhs;
331 return lhs.path < rhs;
335 return lhs.path <= rhs;
339 return lhs.path > rhs;
343 return lhs.path >= rhs;
347 return lhs.path == rhs.path;
351 return lhs.path < rhs.path;
355 return lhs.path <= rhs.path;
359 return lhs.path > rhs.path;
363 return lhs.path >= rhs.path;
368 if (not DataPointPath::ValidPath(lhs)) {
384 this->path += rhs.path;
385 if (not DataPointPath::ValidPath(*
this)) {
392 std::string::value_type this_path_back = this->path.empty() ?
'0' : this->path.back();
393 std::string::value_type rhs_path_front = rhs.path.empty() ?
'0' : rhs.path.front();
394 if (this_path_back !=
'/' and rhs_path_front !=
'/') {
396 this->path +=
"/" + rhs.path;
397 }
else if (this_path_back ==
'/' and rhs_path_front ==
'/') {
399 this->path.append(rhs.path, 1);
401 this->path += rhs.path;
410 inline DataPointPath::operator std::string() const noexcept {
421 #endif // RTCTK_COMPONENTFRAMEWORK_DATAPOINTPATH_HPP
Provides macros and utilities for exception handling.
friend bool operator>=(const char *lhs, const DataPointPath &rhs) noexcept
Definition: dataPointPath.hpp:231
DataPointPath(DataPointPath &&)=default
DataPointPath operator/(DataPointPath lhs, const DataPointPath &rhs)
Definition: dataPointPath.hpp:374
friend bool operator>(const char *lhs, const DataPointPath &rhs) noexcept
Definition: dataPointPath.hpp:228
friend bool operator>(const DataPointPath &lhs, const char *rhs) noexcept
Definition: dataPointPath.hpp:318
friend std::istream & operator>>(std::istream &input, DataPointPath &path)
Read into DataPointPath from istream.
Definition: dataPointPath.cpp:92
DataPointPath & operator=(DataPointPath &&)=default
Definition: commandReplier.cpp:20
friend bool operator>(const std::string &lhs, const DataPointPath &rhs) noexcept
Definition: dataPointPath.hpp:247
friend bool operator==(const char *lhs, const DataPointPath &rhs) noexcept
Definition: dataPointPath.hpp:216
bool operator<=(const DataPointPath &lhs, const char *rhs) noexcept
Definition: dataPointPath.hpp:314
std::ostream & operator<<(std::ostream &os, AlertServiceIf::AlertStatus const &status)
Definition: alertServiceIf.cpp:59
const std::string & ToString() const noexcept
Get string representing the DataPointPath.
Definition: dataPointPath.hpp:379
virtual ~DataPointPath()=default
static elt::mal::Uri AppendSuffixToUriPath(const std::string &suffix, const elt::mal::Uri &uri)
Appends a suffix string to the path of a URI.
Definition: dataPointPath.cpp:70
DataPointPath & operator=(const DataPointPath &)=default
friend bool operator!=(const DataPointPath &lhs, const std::string &rhs) noexcept
Definition: dataPointPath.hpp:198
DataPointPath(const DataPointPath &)=default
bool operator>(const DataPointPath &lhs, const char *rhs) noexcept
Definition: dataPointPath.hpp:318
friend bool operator<(const char *lhs, const DataPointPath &rhs) noexcept
Definition: dataPointPath.hpp:222
friend bool operator==(const DataPointPath &lhs, const char *rhs) noexcept
Definition: dataPointPath.hpp:306
friend bool operator==(const std::string &lhs, const DataPointPath &rhs) noexcept
Definition: dataPointPath.hpp:235
InvalidPathException(const std::string &path)
Definition: dataPointPath.cpp:17
friend bool operator<(const DataPointPath &lhs, const char *rhs) noexcept
Definition: dataPointPath.hpp:310
DataPointPath & operator+=(const DataPointPath &rhs)
Append another DataPointPath to this DataPointPath without adding a path seperator,...
Definition: dataPointPath.hpp:383
friend bool operator!=(const char *lhs, const DataPointPath &rhs) noexcept
Definition: dataPointPath.hpp:219
Exception class used when an invalid character is used in a DataPointPath.
Definition: dataPointPath.hpp:70
friend bool operator<=(const char *lhs, const DataPointPath &rhs) noexcept
Definition: dataPointPath.hpp:225
friend bool operator>=(const DataPointPath &lhs, const char *rhs) noexcept
Definition: dataPointPath.hpp:322
Definition: mudpiProcessingError.hpp:119
friend bool operator!=(const std::string &lhs, const DataPointPath &rhs) noexcept
Definition: dataPointPath.hpp:238
DataPointPath(const char *const new_path)
Create DataPointPath from a null terminated character string.
Definition: dataPointPath.hpp:105
friend bool operator>=(const std::string &lhs, const DataPointPath &rhs) noexcept
Definition: dataPointPath.hpp:250
friend bool operator<(const std::string &lhs, const DataPointPath &rhs) noexcept
Definition: dataPointPath.hpp:241
friend bool operator!=(const DataPointPath &lhs, const DataPointPath &rhs) noexcept
Definition: dataPointPath.hpp:207
This class provides a wrapper for a data point path.
Definition: dataPointPath.hpp:65
DataPointPath & operator/=(const DataPointPath &rhs)
Append another DataPointPath to this DataPointPath with a path seperator (/) in between if needed.
Definition: dataPointPath.hpp:391
bool operator==(const DataPointPath &lhs, const char *rhs) noexcept
Definition: dataPointPath.hpp:306
bool operator<(const DataPointPath &lhs, const char *rhs) noexcept
Definition: dataPointPath.hpp:310
DataPointPath operator+(DataPointPath lhs, const DataPointPath &rhs)
Definition: dataPointPath.hpp:366
elt::mal::Uri ToRepositoryURI(const elt::mal::Uri &base_uri) const
Creates and returns a complete URI.
Definition: dataPointPath.cpp:65
friend bool operator<=(const DataPointPath &lhs, const char *rhs) noexcept
Definition: dataPointPath.hpp:314
bool operator>=(const DataPointPath &lhs, const char *rhs) noexcept
Definition: dataPointPath.hpp:322
friend bool operator<=(const std::string &lhs, const DataPointPath &rhs) noexcept
Definition: dataPointPath.hpp:244