mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
AK: Add [[nodiscard]] to LexicalPath methods construction objects
This commit is contained in:
parent
dde888a3d4
commit
36c3962670
Notes:
sideshowbarker
2024-07-18 11:13:16 +09:00
Author: https://github.com/MaxWipfli Commit: https://github.com/SerenityOS/serenity/commit/36c39626702 Pull-request: https://github.com/SerenityOS/serenity/pull/8320 Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/awesomekling
1 changed files with 8 additions and 8 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue