From 825b4f09ca6f551551c4f3be5d72517eab504860 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 2 Dec 2025 15:57:26 -0500 Subject: chore: new Kernel API for KString, ArrayList and ErrorOr. Signed-off-by: Amlal El Mahrouss --- src/kernel/NeKit/KString.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/kernel/NeKit/KString.h') diff --git a/src/kernel/NeKit/KString.h b/src/kernel/NeKit/KString.h index fa0ebcbf..a27084cb 100644 --- a/src/kernel/NeKit/KString.h +++ b/src/kernel/NeKit/KString.h @@ -13,14 +13,14 @@ #include namespace Kernel { -inline auto kMinimumStringSize = 8196; +inline constexpr Int kMinimumStringSize = 8196; /// @brief Kernel string class, not dynamic. -template +template class KBasicString final { public: explicit KBasicString() { - fDataSz = kMinimumStringSize; + fDataSz = MinSz; fData = new CharKind[fDataSz]; MUST_PASS(fData); @@ -53,15 +53,15 @@ class KBasicString final { bool operator==(const CharKind* rhs) const; bool operator!=(const CharKind* rhs) const; - bool operator==(const KBasicString& rhs) const; - bool operator!=(const KBasicString& rhs) const; + bool operator==(const KBasicString& rhs) const; + bool operator!=(const KBasicString& rhs) const; - KBasicString& operator+=(const CharKind* rhs); - KBasicString& operator+=(const KBasicString& rhs); + KBasicString& operator+=(const CharKind* rhs); + KBasicString& operator+=(const KBasicString& rhs); operator const char*() { return fData; } - operator bool() { return fData; } + explicit operator bool() { return fData; } bool operator!() { return fData; } @@ -78,8 +78,8 @@ using KStringOr = ErrorOr; class KStringBuilder final { public: - template - static ErrorOr> Construct(const CharKind* data); + template + static ErrorOr> Construct(const CharKind* data); template static const CharKind* FromBool(const CharKind* fmt, bool n); template -- cgit v1.2.3