throw std::out_of_range("trying to get label at position "+std::to_string(pos)+" of a DNSName that only has "+std::to_string(currentPos)+" labels");
}
+DNSName DNSName::getLastLabel() const
+{
+ DNSName ret(*this);
+ ret.trimToLabels(1);
+ return ret;
+}
+
bool DNSName::chopOff()
{
if(d_storage.empty() || d_storage[0]==0)
void prependRawLabel(const std::string& str); //!< Prepend this unescaped label
std::vector<std::string> getRawLabels() const; //!< Individual raw unescaped labels
std::string getRawLabel(unsigned int pos) const; //!< Get the specified raw unescaped label
+ DNSName getLastLabel() const; //!< Get the DNSName of the last label
bool chopOff(); //!< Turn www.powerdns.com. into powerdns.com., returns false for .
DNSName makeRelative(const DNSName& zone) const;
DNSName makeLowerCase() const