Esempio n. 1
0
bool operator == (const URI& lhs, const URI& rhs) noexcept {
  return icase_equal(lhs.scheme(), rhs.scheme())
         and (lhs.userinfo() == rhs.userinfo())
         and icase_equal(lhs.host(), rhs.host())
         and lhs.port() == rhs.port()
         and lhs.path() == rhs.path()
         and lhs.query() == rhs.query()
         and lhs.fragment() == rhs.fragment();
}
Esempio n. 2
0
std::size_t URI::HashFn::operator()(const URI& uri) const
{
    std::size_t seed = 0;

    if (uri.scheme()) {
        boost::hash_combine(seed, *uri.scheme());
    }

    if (uri.authority()) {
        boost::hash_combine(seed, *uri.authority());
    }

    boost::hash_combine(seed, uri.path());

    if (uri.query()) {
        boost::hash_combine(seed, *uri.query());
    }

    if (uri.fragment()) {
        boost::hash_combine(seed, *uri.fragment());
    }

    return seed;
}