1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:27:45 +00:00

AK: Add URL::basename()

This commit is contained in:
Andreas Kling 2020-05-05 23:56:35 +02:00
parent 68abc103f7
commit ae047649db
2 changed files with 8 additions and 0 deletions

View file

@ -366,4 +366,11 @@ URL URL::create_with_url_or_path(const String& url_or_path)
return URL::create_with_file_protocol(path);
}
String URL::basename() const
{
if (!m_valid)
return {};
return FileSystemPath(m_path).basename();
}
}