From 8a7396493c3effb356d2dc4484b993b4698bc422 Mon Sep 17 00:00:00 2001 From: Amlal Date: Sun, 27 Apr 2025 23:31:27 +0200 Subject: dev, kernel: HeFS had to be redesigned to be less problematic with hard-drives. why? the struct were way too big to fit wihin a sector. Signed-off-by: Amlal --- dev/kernel/NewKit/KString.h | 9 +++++---- dev/kernel/NewKit/Utils.h | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'dev/kernel/NewKit') diff --git a/dev/kernel/NewKit/KString.h b/dev/kernel/NewKit/KString.h index 133fe945..a9a58b7e 100644 --- a/dev/kernel/NewKit/KString.h +++ b/dev/kernel/NewKit/KString.h @@ -12,14 +12,14 @@ #include #include -#define cMinimumStringSize 8196 +#define kMinimumStringSize (8196U) namespace Kernel { /// @brief Kernel string class, not dynamic. class KString final { public: explicit KString() { - fDataSz = cMinimumStringSize; + fDataSz = kMinimumStringSize; fData = new Char[fDataSz]; MUST_PASS(fData); @@ -70,12 +70,13 @@ class KString final { friend class KStringBuilder; }; -struct KStringBuilder final { +class KStringBuilder final { +public: static ErrorOr Construct(const Char* data); static const Char* FromBool(const Char* fmt, bool n); static const Char* Format(const Char* fmt, const Char* from); static bool Equals(const Char* lhs, const Char* rhs); - static bool Equals(const Utf16Char* lhs, const Utf16Char* rhs); + static bool Equals(const Utf8Char* lhs, const Utf8Char* rhs); static bool Equals(const WideChar* lhs, const WideChar* rhs); }; } // namespace Kernel diff --git a/dev/kernel/NewKit/Utils.h b/dev/kernel/NewKit/Utils.h index 2f0fc60b..0cf0484a 100644 --- a/dev/kernel/NewKit/Utils.h +++ b/dev/kernel/NewKit/Utils.h @@ -27,6 +27,6 @@ Int rt_to_lower(Int c); voidPtr rt_string_in_string(const Char* in, const Char* needle); char* rt_string_has_char(Char* str, Char chr); -Int wrt_copy_memory(const voidPtr src, voidPtr dst, Size len); -Size wrt_string_len(const Utf16Char* str); +Int urt_copy_memory(const voidPtr src, voidPtr dst, Size len); +Size urt_string_len(const Utf8Char* str); } // namespace Kernel -- cgit v1.2.3