89 for (
const auto &pt : path_toks) {
91 if (subtoks.size() == 2) {
92 result.push_back(subtoks.at(0));
93 result.push_back(fmt::format(
":{}", subtoks.at(1)));
96 result.push_back(subtoks.at(0));
122 container_type::const_iterator
end,
140 throw std::runtime_error(
141 "Cannot assign a path to a path with another path type.");
153 path(std::initializer_list<std::string> ns,
157 if ((ns.size() == 1) &&
161 else if ((ns.size() == 1) && ns.begin()->empty()) {
167 explicit path(
const std::vector<std::string> &ns,
171 if ((ns.size() == 1) &&
175 else if ((ns.size() == 1) && ns.begin()->empty()) {
183 return (left.is_root() == right.is_root()) &&
184 (left.path_ == right.path_);
189 return left.to_string() < right.to_string();
274 const std::string &
operator[](
const unsigned int index)
const
293 for (
const auto &n : ns) {
303 if (!
path_.empty()) {
321 return {std::move(res)};
355 for (
auto i = 0U; i < std::min(
size(), right.size()); i++) {
356 if (
path_[i] == right[i])
377 if (res.starts_with(right)) {
402 auto it = res.find(ns_prefix);
404 while (it != std::string::npos) {
405 res.erase(it, ns_prefix.size());
406 it = res.find(ns_prefix);
424 path::container_type::iterator
begin() {
return path_.begin(); }
425 path::container_type::iterator
end() {
return path_.end(); }
427 path::container_type::const_iterator
cbegin()
const
429 return path_.cbegin();
431 path::container_type::const_iterator
cend()
const {
return path_.cend(); }
433 path::container_type::const_iterator
begin()
const {
return path_.begin(); }
434 path::container_type::const_iterator
end()
const {
return path_.end(); }