Changeset View
Changeset View
Standalone View
Standalone View
src/script/descriptor.cpp
Show First 20 Lines • Show All 504 Lines • ▼ Show 20 Lines | std::vector<Span<const char>> Split(const Span<const char> &sp, char sep) { | ||||
ret.emplace_back(start, it); | ret.emplace_back(start, it); | ||||
return ret; | return ret; | ||||
} | } | ||||
/** | /** | ||||
* Parse a key path, being passed a split list of elements (the first element is | * Parse a key path, being passed a split list of elements (the first element is | ||||
* ignored). | * ignored). | ||||
*/ | */ | ||||
bool ParseKeyPath(const std::vector<Span<const char>> &split, KeyPath &out) { | NODISCARD bool ParseKeyPath(const std::vector<Span<const char>> &split, | ||||
KeyPath &out) { | |||||
for (size_t i = 1; i < split.size(); ++i) { | for (size_t i = 1; i < split.size(); ++i) { | ||||
Span<const char> elem = split[i]; | Span<const char> elem = split[i]; | ||||
bool hardened = false; | bool hardened = false; | ||||
if (elem.size() > 0 && | if (elem.size() > 0 && | ||||
(elem[elem.size() - 1] == '\'' || elem[elem.size() - 1] == 'h')) { | (elem[elem.size() - 1] == '\'' || elem[elem.size() - 1] == 'h')) { | ||||
elem = elem.first(elem.size() - 1); | elem = elem.first(elem.size() - 1); | ||||
hardened = true; | hardened = true; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 162 Lines • Show Last 20 Lines |