mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00: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
2 changed files with 6 additions and 0 deletions
|
@ -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 a new issue