diff --git a/AK/URL.h b/AK/URL.h index dc2f098b95f..e81187fd21a 100644 --- a/AK/URL.h +++ b/AK/URL.h @@ -73,6 +73,13 @@ public: static URL create_with_url_or_path(const String& url_or_path); static URL create_with_file_protocol(const String& path); + bool operator==(const URL& other) const + { + if (this == &other) + return true; + return to_string() == other.to_string(); + } + private: bool parse(const StringView&); bool compute_validity() const; @@ -94,4 +101,9 @@ inline const LogStream& operator<<(const LogStream& stream, const URL& value) return stream << value.to_string(); } +template<> +struct Traits : public GenericTraits { + static unsigned hash(const URL& url) { return url.to_string().hash(); } +}; + }