File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Userland/Libraries/LibCore Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,14 @@ String Resource::filesystem_path() const
58
58
return ResourceImplementation::the ().filesystem_path (*this );
59
59
}
60
60
61
+ String Resource::file_url () const
62
+ {
63
+ if (m_scheme == Scheme::File)
64
+ return uri ();
65
+
66
+ return MUST (String::formatted (" file://{}" , filesystem_path ()));
67
+ }
68
+
61
69
String Resource::filename () const
62
70
{
63
71
return MUST (String::from_utf8 (LexicalPath (m_path.bytes_as_string_view ()).basename ()));
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ class Resource : public RefCounted<Resource> {
30
30
[[nodiscard]] String uri () const ;
31
31
[[nodiscard]] String filename () const ;
32
32
[[nodiscard]] String filesystem_path () const ;
33
+ [[nodiscard]] String file_url () const ;
33
34
34
35
[[nodiscard]] ByteBuffer clone_data () const ;
35
36
[[nodiscard]] ByteBuffer release_data () &&;
You can’t perform that action at this time.
0 commit comments