mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-08-16 17:00:35 +03:00
AK: Add LexicalPath::prepend()
This commit is contained in:
parent
5f3e9886f7
commit
07351762c7
Notes:
sideshowbarker
2024-07-18 00:53:01 +09:00
Author: https://github.com/timschumi Commit: https://github.com/SerenityOS/serenity/commit/07351762c75 Pull-request: https://github.com/SerenityOS/serenity/pull/11000
@ -164,6 +164,11 @@ LexicalPath LexicalPath::append(StringView value) const
|
||||
return LexicalPath::join(m_string, value);
|
||||
}
|
||||
|
||||
LexicalPath LexicalPath::prepend(StringView value) const
|
||||
{
|
||||
return LexicalPath::join(value, m_string);
|
||||
}
|
||||
|
||||
LexicalPath LexicalPath::parent() const
|
||||
{
|
||||
return append("..");
|
||||
|
@ -30,6 +30,7 @@ public:
|
||||
bool has_extension(StringView) const;
|
||||
|
||||
[[nodiscard]] LexicalPath append(StringView) const;
|
||||
[[nodiscard]] LexicalPath prepend(StringView) const;
|
||||
[[nodiscard]] LexicalPath parent() const;
|
||||
|
||||
[[nodiscard]] static String canonicalized_path(String);
|
||||
|
Loading…
Reference in New Issue
Block a user