mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 00:31:14 +00:00
AK: Add URL::create_with_file_protocol(path)
This is a convenience helper that allows you to easily construct a file:// URL from an absolute path.
This commit is contained in:
parent
75daf3857b
commit
79eee65372
Notes:
sideshowbarker
2024-07-19 07:29:51 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/79eee65372e
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue