1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 09:47:34 +00:00

AK: Make LexicalPath immutable

This replaces the current LexicalPath::append() API with a new method
that returns a new LexicalPath object and doesn't touch the this-object.
With this, LexicalPath is now immutable. It also adds a
LexicalPath::parent() method and the relevant test cases.
This commit is contained in:
Max Wipfli 2021-06-29 17:55:12 +02:00 committed by Andreas Kling
parent 1e80022282
commit 4c018909f7
3 changed files with 38 additions and 11 deletions

View file

@ -30,7 +30,8 @@ public:
bool has_extension(StringView const&) const;
void append(String const& component);
[[nodiscard]] LexicalPath append(StringView const&) const;
[[nodiscard]] LexicalPath parent() const;
static String canonicalized_path(String);
static String relative_path(String absolute_path, String const& prefix);