24 #include <boost/algorithm/string.hpp> 29 namespace validator_config {
38 return os <<
"is-prefix-of";
40 return os <<
"is-strict-prefix-of";
50 return name1 == name2;
62 if (boost::iequals(relationString,
"equal")) {
65 else if (boost::iequals(relationString,
"is-prefix-of")) {
68 else if (boost::iequals(relationString,
"is-strict-prefix-of")) {
72 BOOST_THROW_EXCEPTION(
Error(
"Unsupported relation: " + relationString));
Copyright (c) 2013-2017 Regents of the University of California.
std::ostream & operator<<(std::ostream &os, NameRelation relation)
bool checkNameRelation(NameRelation relation, const Name &name1, const Name &name2)
check whether name1 and name2 satisfies relation
NameRelation getNameRelationFromString(const std::string &relationString)
convert relationString to NameRelation
size_t size() const
Get number of components.
Represents an absolute name.
bool isPrefixOf(const Name &other) const
Check if this name is a prefix of another name.