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

Kernel: Add a KString::bytes() helper

This commit is contained in:
Idan Horowitz 2022-01-13 00:36:33 +02:00 committed by Brian Gianforcaro
parent 3098b11c07
commit 0e44bb7d82

View file

@ -43,6 +43,7 @@ public:
[[nodiscard]] size_t length() const { return m_length; } [[nodiscard]] size_t length() const { return m_length; }
[[nodiscard]] char const* characters() const { return m_characters; } [[nodiscard]] char const* characters() const { return m_characters; }
[[nodiscard]] StringView view() const { return { characters(), length() }; } [[nodiscard]] StringView view() const { return { characters(), length() }; }
[[nodiscard]] ReadonlyBytes bytes() const { return { characters(), length() }; }
private: private:
explicit KString(size_t length) explicit KString(size_t length)