Strategy::ParsedInstanceName Strategy::parseInstanceName(const Name& input) { for (ssize_t i = input.size() - 1; i > 0; --i) { if (input[i].isVersion()) { return {input.getPrefix(i + 1), input[i].toVersion(), input.getSubName(i + 1)}; } } return {input, nullopt, PartialName()}; }
Name& Name::append(const PartialName& name) { if (&name == this) // Copying from this name, so need to make a copy first. return append(PartialName(name)); for (size_t i = 0; i < name.size(); ++i) append(name.at(i)); return *this; }