std::string toString() const; //!< Our human-friendly, escaped, representation
std::string toDNSString() const; //!< Our representation in DNS native format
+ const char* toCString() const; //!< Easy access to toString().c_str();
void appendRawLabel(const std::string& str); //!< Append this unescaped label
void prependRawLabel(const std::string& str); //!< Prepend this unescaped label
std::vector<std::string> getRawLabels() const; //!< Individual raw unescaped labels
cmap_t::const_iterator start=iter;
for(; iter != mc.d_map.end(); ++iter) {
- if(iter->qname.compare(0, zone.size(), zone) != 0) {
+ if(iter->qname.toString().compare(0, zone.size(), zone) != 0) { //TODO: check if there is a nicer method for this
break;
}
delcount++;
ordered_unique<
composite_key<
CacheEntry,
- member<CacheEntry,string,&CacheEntry::qname>,
+ member<CacheEntry,DNSName,&CacheEntry::qname>,
member<CacheEntry,uint16_t,&CacheEntry::qtype>,
member<CacheEntry,uint16_t, &CacheEntry::ctype>,
member<CacheEntry,int, &CacheEntry::zoneID>,
member<CacheEntry,bool, &CacheEntry::dnssecOk>,
member<CacheEntry,bool, &CacheEntry::hasEDNS>
>,
- composite_key_compare<std::less<string>, std::less<uint16_t>, std::less<uint16_t>, std::less<int>, std::less<bool>,
+ composite_key_compare<std::less<DNSName>, std::less<uint16_t>, std::less<uint16_t>, std::less<int>, std::less<bool>,
std::less<unsigned int>, std::less<bool>, std::less<bool> >
>,
sequenced<>
};
vector<MapCombo> d_maps;
- MapCombo& getMap(const std::string& qname)
+ MapCombo& getMap(const DNSName& qname)
{
- return d_maps[burtle((const unsigned char*)qname.c_str(), qname.length(), 0) % d_maps.size()];
+ return d_maps[burtle((const unsigned char*)qname.toCString(), qname.toString().length(), 0) % d_maps.size()];
}