13#ifndef RTCTK_COMPONENTFRAMEWORK_DATAPOINTPATH_HPP
14#define RTCTK_COMPONENTFRAMEWORK_DATAPOINTPATH_HPP
20#include <fmt/format.h>
21#include <mal/utility/Uri.hpp>
125 const std::string& ToString() const noexcept;
149 operator
std::
string() const noexcept;
206 friend
bool operator==(const
DataPointPath& lhs, const
char* rhs) noexcept;
207 friend
bool operator!=(const
DataPointPath& lhs, const
char* rhs) noexcept {
208 return !(lhs == rhs);
217 return !(lhs == rhs);
226 return !(lhs == rhs);
238 return !(rhs == lhs);
257 return !(rhs == lhs);
287 elt::mal::Uri ToRepositoryURI(
const elt::mal::Uri& base_uri)
const;
298 std::pair<DataPointPath, DataPointPath> Split()
const;
321 bool IsAbsolutePath()
const;
330 std::vector<DataPointPath> SplitAll()
const;
345 static elt::mal::Uri AppendSuffixToUriPath(
const std::string& suffix,
const elt::mal::Uri& uri);
353 RTCTK_LOCAL static bool ValidPath(
const std::string& path);
358 RTCTK_LOCAL const static std::string VALID_CHARACTERS;
361 RTCTK_LOCAL const static std::regex REGEX_VALID_CHARS;
364RTCTK_API DataPointPath
operator"" _dppath(
const char* str, std::size_t len);
369 return lhs.m_path == rhs;
373 return lhs.m_path < rhs;
377 return lhs.m_path <= rhs;
381 return lhs.m_path > rhs;
385 return lhs.m_path >= rhs;
389 return lhs.m_path == rhs;
393 return lhs.m_path < rhs;
397 return lhs.m_path <= rhs;
401 return lhs.m_path > rhs;
405 return lhs.m_path >= rhs;
409 return lhs.m_path == rhs.m_path;
413 return lhs.m_path < rhs.m_path;
417 return lhs.m_path <= rhs.m_path;
421 return lhs.m_path > rhs.m_path;
425 return lhs.m_path >= rhs.m_path;
446inline DataPointPath::operator std::string() const noexcept {
469struct RTCTK_API fmt::formatter<rtctk::componentFramework::DataPointPath>
470 : fmt::formatter<std::string> {
472 fmt::format_context& ctx)
const -> fmt::format_context::iterator;
InvalidPathException(const std::string &path)
Definition dataPointPath.cpp:20
This class provides a wrapper for a data point path.
Definition dataPointPath.hpp:77
friend bool operator!=(const DataPointPath &lhs, const DataPointPath &rhs) noexcept
Definition dataPointPath.hpp:225
friend bool operator<=(const std::string &lhs, const DataPointPath &rhs) noexcept
Definition dataPointPath.hpp:262
friend bool operator>=(const char *lhs, const DataPointPath &rhs) noexcept
Definition dataPointPath.hpp:249
friend bool operator>(const char *lhs, const DataPointPath &rhs) noexcept
Definition dataPointPath.hpp:246
friend bool operator<(const char *lhs, const DataPointPath &rhs) noexcept
Definition dataPointPath.hpp:240
friend bool operator!=(const std::string &lhs, const DataPointPath &rhs) noexcept
Definition dataPointPath.hpp:256
friend bool operator>=(const std::string &lhs, const DataPointPath &rhs) noexcept
Definition dataPointPath.hpp:268
friend bool operator!=(const char *lhs, const DataPointPath &rhs) noexcept
Definition dataPointPath.hpp:237
friend bool operator!=(const DataPointPath &lhs, const std::string &rhs) noexcept
Definition dataPointPath.hpp:216
friend bool operator<=(const char *lhs, const DataPointPath &rhs) noexcept
Definition dataPointPath.hpp:243
friend bool operator<(const std::string &lhs, const DataPointPath &rhs) noexcept
Definition dataPointPath.hpp:259
const std::string & ToString() const noexcept
Get string representing the DataPointPath.
Definition dataPointPath.hpp:438
friend bool operator>(const std::string &lhs, const DataPointPath &rhs) noexcept
Definition dataPointPath.hpp:265
operator std::string() const noexcept
Cast operator to string (implicit).
Definition dataPointPath.hpp:446
DataPointPath(const char *const new_path)
Create DataPointPath from a null terminated character string.
Definition dataPointPath.hpp:119
DataPointPath & operator=(DataPointPath &&)=default
DataPointPath & operator=(const DataPointPath &)=default
DataPointPath(DataPointPath &&)=default
friend bool operator==(const std::string &lhs, const DataPointPath &rhs) noexcept
Definition dataPointPath.hpp:253
friend bool operator==(const char *lhs, const DataPointPath &rhs) noexcept
Definition dataPointPath.hpp:234
DataPointPath(const DataPointPath &)=default
RtctkException() noexcept
Definition exceptions.cpp:113
Project-wide configuration header.
#define RTCTK_LOCAL
Helper to hide a class or function from the public symbol table.
Definition config.hpp:60
#define RTCTK_API
Helper to indicate that a class or function must be exported in the public symbol table.
Definition config.hpp:33
Provides macros and utilities for exception handling.
Defines the JSON payload type JsonPayload.
Definition commandReplier.cpp:22
DataPointPath operator/(DataPointPath lhs, const DataPointPath &rhs)
Definition dataPointPath.hpp:433
bool operator<=(const DataPointPath &lhs, const char *rhs) noexcept
Definition dataPointPath.hpp:376
bool operator>(const DataPointPath &lhs, const char *rhs) noexcept
Definition dataPointPath.hpp:380
bool operator==(const DataPointPath &lhs, const char *rhs) noexcept
Definition dataPointPath.hpp:368
void to_json(JsonPayload &j, const DataPointPath &v)
Definition dataPointPath.cpp:218
std::istream & operator>>(std::istream &input, DataPointPath &path)
Definition dataPointPath.cpp:204
bool operator>=(const DataPointPath &lhs, const char *rhs) noexcept
Definition dataPointPath.hpp:384
nlohmann::json JsonPayload
Type requirements:
Definition jsonPayload.hpp:25
std::ostream & operator<<(std::ostream &out, const DataPointPath &rhs)
Definition dataPointPath.hpp:450
void from_json(const JsonPayload &j, DataPointPath &v)
Definition dataPointPath.cpp:223
bool operator<(const DataPointPath &lhs, const char *rhs) noexcept
Definition dataPointPath.hpp:372
DataPointPath operator+(DataPointPath lhs, const DataPointPath &rhs)
Definition dataPointPath.hpp:428
Definition ddsSub.hpp:156