unsigned long NamePool::hash(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName) { unsigned long h = 0; XMLString::const_iterator it = qname.begin(); XMLString::const_iterator end = qname.end(); while (it != end) h = (h << 5) + h + (unsigned long) *it++; it = namespaceURI.begin(); end = namespaceURI.end(); while (it != end) h = (h << 5) + h + (unsigned long) *it++; it = localName.begin(); end = localName.end(); while (it != end) h = (h << 5) + h + (unsigned long) *it++; return h; }
std::string fromXMLString(const XMLString& str) { std::string result; result.reserve(str.size()); for (XMLString::const_iterator it = str.begin(); it != str.end(); ++it) { char c; wctomb(&c, *it); result += c; } return result; }