示例#1
0
文件: strategy.cpp 项目: cawka/NFD
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()};
}
示例#2
0
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;
}