10 #include "boost/functional/hash.hpp"
18 explicit Ns_iri(
char const* nsiri) : str_(nsiri) {}
19 explicit Ns_iri(std::string
const& nsiri) : str_(nsiri) {}
20 Ns_iri(
char const* nsiri,
const std::size_t n) : str_(nsiri, n) {}
22 bool operator==(
Ns_iri const& n)
const {
return str_ == n.str_;}
23 bool operator==(std::string
const& str)
const {
return str_ == str;}
25 std::string
const& str()
const {
return str_;}
31 template<
class Ch,
class Tr>
inline std::basic_ostream<Ch,Tr>&
32 operator<<(std::basic_ostream<Ch,Tr>& os,
Ns_iri const& ns_iri)
33 {
return os << ns_iri.str();}
35 inline std::size_t hash_value(Ns_iri
const& n)
36 {
return boost::hash_value(n.str());}
46 if( n == std::string::npos ) {
50 return Ns_iri(iri.substr(0,n++));
62 inline std::string add_fragment(Ns_iri
const& nsiri, std::string
const& frag) {
63 return nsiri.str() +
'#' + frag;