diff options
Diffstat (limited to 'AK/LexicalPath.cpp')
-rw-r--r-- | AK/LexicalPath.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/AK/LexicalPath.cpp b/AK/LexicalPath.cpp index e4dbf706ff..0e18d00365 100644 --- a/AK/LexicalPath.cpp +++ b/AK/LexicalPath.cpp @@ -116,4 +116,15 @@ String LexicalPath::relative_path(String absolute_path, const String& prefix) return absolute_path.substring(prefix_length); } +void LexicalPath::append(String const& component) +{ + StringBuilder builder; + builder.append(m_string); + builder.append('/'); + builder.append(component); + + m_string = builder.to_string(); + canonicalize(); +} + } |