mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:38:11 +00:00
AK: Add LexicalPath::prepend()
This commit is contained in:
parent
5f3e9886f7
commit
07351762c7
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);
|
return LexicalPath::join(m_string, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LexicalPath LexicalPath::prepend(StringView value) const
|
||||||
|
{
|
||||||
|
return LexicalPath::join(value, m_string);
|
||||||
|
}
|
||||||
|
|
||||||
LexicalPath LexicalPath::parent() const
|
LexicalPath LexicalPath::parent() const
|
||||||
{
|
{
|
||||||
return append("..");
|
return append("..");
|
||||||
|
|
|
@ -30,6 +30,7 @@ public:
|
||||||
bool has_extension(StringView) const;
|
bool has_extension(StringView) const;
|
||||||
|
|
||||||
[[nodiscard]] LexicalPath append(StringView) const;
|
[[nodiscard]] LexicalPath append(StringView) const;
|
||||||
|
[[nodiscard]] LexicalPath prepend(StringView) const;
|
||||||
[[nodiscard]] LexicalPath parent() const;
|
[[nodiscard]] LexicalPath parent() const;
|
||||||
|
|
||||||
[[nodiscard]] static String canonicalized_path(String);
|
[[nodiscard]] static String canonicalized_path(String);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue