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.path_ == right.path_;
188 return left.to_string() < right.to_string();
264 const std::string &
operator[](
const unsigned int index)
const
283 for (
const auto &n : ns) {
293 if (!
path_.empty()) {
311 return {std::move(res)};
345 for (
auto i = 0U; i < std::min(
size(), right.size()); i++) {
346 if (
path_[i] == right[i])
366 if (res.starts_with(right))
389 auto it = res.find(ns_prefix);
390 while (it != std::string::npos) {
391 res.erase(it, ns_prefix.size());
392 it = res.find(ns_prefix);
410 path::container_type::iterator
begin() {
return path_.begin(); }
411 path::container_type::iterator
end() {
return path_.end(); }
413 path::container_type::const_iterator
cbegin()
const
415 return path_.cbegin();
417 path::container_type::const_iterator
cend()
const {
return path_.cend(); }
419 path::container_type::const_iterator
begin()
const {
return path_.begin(); }
420 path::container_type::const_iterator
end()
const {
return path_.end(); }