예제 #1
0
파일: uri.cpp 프로젝트: AnnikaH/IncludeOS
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();
}
예제 #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;
}