diff --git a/AK/URL.cpp b/AK/URL.cpp index 62e23e062c..329f13f07c 100644 --- a/AK/URL.cpp +++ b/AK/URL.cpp @@ -287,4 +287,12 @@ bool URL::compute_validity() const return true; } +URL URL::create_with_file_protocol(const String& path) +{ + URL url; + url.set_protocol("file"); + url.set_path(path); + return url; +} + } diff --git a/AK/URL.h b/AK/URL.h index 7cc82d83be..4f827cbd03 100644 --- a/AK/URL.h +++ b/AK/URL.h @@ -65,6 +65,8 @@ public: URL complete_url(const String&) const; + static URL create_with_file_protocol(const String& path); + private: bool parse(const StringView&); bool compute_validity() const;