{
d_tree.add(dnsname, true);
d_nodes.insert(dnsname);
- updateHuman();
}
void add(std::vector<std::string> labels)
labels.pop_back(); // This is safe because we have a copy of labels
}
d_nodes.insert(tmp);
- updateHuman();
}
void remove(const DNSName& name)
{
d_tree.remove(name);
d_nodes.erase(name);
- updateHuman();
}
void remove(std::vector<std::string> labels)
labels.pop_back(); // This is safe because we have a copy of labels
}
d_nodes.erase(tmp);
- updateHuman();
}
bool check(const DNSName& dnsname) const
std::string toString() const
{
- return d_human;
- }
-
- private:
- mutable std::string d_human;
- mutable std::set<DNSName> d_nodes; // Only used for string generation
-
- void updateHuman() {
- std::string tmp;
+ std::string ret;
bool first = true;
for (const auto& n : d_nodes) {
if (!first) {
- tmp += ", ";
+ ret += ", ";
}
first = false;
- tmp += n.toString();
+ ret += n.toString();
}
- d_human = tmp;
+ return ret;
}
+
+ private:
+ mutable std::string d_human;
+ mutable std::set<DNSName> d_nodes; // Only used for string generation
};
std::ostream & operator<<(std::ostream &os, const DNSName& d);