mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-06 02:55:49 +03:00
Kernel: Annotate KString methods as [[nodiscard]]
This commit is contained in:
parent
f2d684fc24
commit
060503ef25
Notes:
sideshowbarker
2024-07-18 22:57:59 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/060503ef252 Pull-request: https://github.com/SerenityOS/serenity/pull/9372
@ -16,19 +16,19 @@ class KString {
|
||||
AK_MAKE_NONMOVABLE(KString);
|
||||
|
||||
public:
|
||||
static OwnPtr<KString> try_create_uninitialized(size_t, char*&);
|
||||
static NonnullOwnPtr<KString> must_create_uninitialized(size_t, char*&);
|
||||
static OwnPtr<KString> try_create(StringView const&);
|
||||
static NonnullOwnPtr<KString> must_create(StringView const&);
|
||||
[[nodiscard]] static OwnPtr<KString> try_create_uninitialized(size_t, char*&);
|
||||
[[nodiscard]] static NonnullOwnPtr<KString> must_create_uninitialized(size_t, char*&);
|
||||
[[nodiscard]] static OwnPtr<KString> try_create(StringView const&);
|
||||
[[nodiscard]] static NonnullOwnPtr<KString> must_create(StringView const&);
|
||||
|
||||
void operator delete(void*);
|
||||
|
||||
OwnPtr<KString> try_clone() const;
|
||||
[[nodiscard]] OwnPtr<KString> try_clone() const;
|
||||
|
||||
bool is_empty() const { return m_length == 0; }
|
||||
size_t length() const { return m_length; }
|
||||
char const* characters() const { return m_characters; }
|
||||
StringView view() const { return { characters(), length() }; }
|
||||
[[nodiscard]] bool is_empty() const { return m_length == 0; }
|
||||
[[nodiscard]] size_t length() const { return m_length; }
|
||||
[[nodiscard]] char const* characters() const { return m_characters; }
|
||||
[[nodiscard]] StringView view() const { return { characters(), length() }; }
|
||||
|
||||
private:
|
||||
explicit KString(size_t length)
|
||||
|
Loading…
Reference in New Issue
Block a user