diff options
author | Max Wipfli <mail@maxwipfli.ch> | 2021-06-29 20:30:45 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-30 11:13:54 +0200 |
commit | 36c396267025f2c3f78be2db3a5dc6cf1052dd0e (patch) | |
tree | 047f72803fd33ba44ed17d1e25b4fe9941922ced | |
parent | dde888a3d447dc7378502e58c81c5e97a533a519 (diff) | |
download | serenity-36c396267025f2c3f78be2db3a5dc6cf1052dd0e.zip |
AK: Add [[nodiscard]] to LexicalPath methods construction objects
-rw-r--r-- | AK/LexicalPath.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/AK/LexicalPath.h b/AK/LexicalPath.h index b065c8c856..a9217d45b2 100644 --- a/AK/LexicalPath.h +++ b/AK/LexicalPath.h @@ -25,18 +25,18 @@ public: StringView const& extension() const { return m_extension; } Vector<StringView> const& parts_view() const { return m_parts; } - Vector<String> parts() const; + [[nodiscard]] Vector<String> parts() const; bool has_extension(StringView const&) const; [[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); + [[nodiscard]] static String canonicalized_path(String); + [[nodiscard]] static String relative_path(String absolute_path, String const& prefix); template<typename... S> - static LexicalPath join(String const& first, S&&... rest) + [[nodiscard]] static LexicalPath join(String const& first, S&&... rest) { StringBuilder builder; builder.append(first); @@ -45,25 +45,25 @@ public: return LexicalPath { builder.to_string() }; } - static String dirname(String path) + [[nodiscard]] static String dirname(String path) { auto lexical_path = LexicalPath(move(path)); return lexical_path.dirname(); } - static String basename(String path) + [[nodiscard]] static String basename(String path) { auto lexical_path = LexicalPath(move(path)); return lexical_path.basename(); } - static String title(String path) + [[nodiscard]] static String title(String path) { auto lexical_path = LexicalPath(move(path)); return lexical_path.title(); } - static String extension(String path) + [[nodiscard]] static String extension(String path) { auto lexical_path = LexicalPath(move(path)); return lexical_path.extension(); |