From 92a98b1b45192125562c5b90fc7d02317f94016e Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 19 Nov 2025 09:33:29 +0100 Subject: feat: kernel: new CRuntimeOverrides file, and documentation improvements. Signed-off-by: Amlal El Mahrouss --- dev/kernel/NeKit/KString.inl | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'dev/kernel/NeKit/KString.inl') diff --git a/dev/kernel/NeKit/KString.inl b/dev/kernel/NeKit/KString.inl index 2ee5afba..50f46837 100644 --- a/dev/kernel/NeKit/KString.inl +++ b/dev/kernel/NeKit/KString.inl @@ -10,7 +10,7 @@ namespace Kernel { template inline void ort_string_append(CharKind* lhs, const CharKind* rhs, Int32 cur) { - SizeT sz_rhs = ort_string_len(rhs); + SizeT sz_rhs = oe_string_len(rhs); SizeT rhs_i = 0; for (; rhs_i < sz_rhs; ++rhs_i) { @@ -46,9 +46,9 @@ inline bool KBasicString::operator==(const KBasicString& rhs template inline bool KBasicString::operator==(const CharKind* rhs) const { - if (ort_string_len(rhs) != this->Length()) return false; + if (oe_string_len(rhs) != this->Length()) return false; - for (Size index = 0; index < ort_string_len(rhs); ++index) { + for (Size index = 0; index < oe_string_len(rhs); ++index) { if (rhs[index] != this->fData[index]) return false; } @@ -68,9 +68,9 @@ inline bool KBasicString::operator!=(const KBasicString& rhs template inline bool KBasicString::operator!=(const CharKind* rhs) const { - if (ort_string_len(rhs) != this->Length()) return false; + if (oe_string_len(rhs) != this->Length()) return false; - for (Size index = 0; index < ort_string_len(rhs); ++index) { + for (Size index = 0; index < oe_string_len(rhs); ++index) { if (rhs[index] == this->fData[index]) return false; } @@ -79,10 +79,10 @@ inline bool KBasicString::operator!=(const CharKind* rhs) const { template inline KBasicString& KBasicString::operator+=(const KBasicString& rhs) { - if (ort_string_len(rhs.fData) > this->Length()) return *this; + if (oe_string_len(rhs.fData) > this->Length()) return *this; ort_string_append(this->fData, const_cast(rhs.fData), this->fCur); - this->fCur += ort_string_len(const_cast(rhs.fData)); + this->fCur += oe_string_len(const_cast(rhs.fData)); return *this; } @@ -90,7 +90,7 @@ inline KBasicString& KBasicString::operator+=(const KBasicSt template inline KBasicString& KBasicString::operator+=(const CharKind* rhs) { ort_string_append(this->fData, const_cast(rhs), this->fCur); - this->fCur += ort_string_len(const_cast(rhs)); + this->fCur += oe_string_len(const_cast(rhs)); return *this; } @@ -99,7 +99,7 @@ template inline ErrorOr> KStringBuilder::Construct(const CharKind* data) { if (!data || *data == 0) return ErrorOr>(nullptr); - KBasicString* view = new KBasicString(ort_string_len(data)); + KBasicString* view = new KBasicString(oe_string_len(data)); (*view) += data; return ErrorOr>(*view); @@ -109,12 +109,12 @@ inline const CharKind* KStringBuilder::FromBool(const CharKind* fmt, bool i) { if (!fmt) return ("?"); const CharKind* boolean_expr = i ? "YES" : "NO"; - CharKind* ret = (CharKind*) RTL_ALLOCA(ort_string_len(boolean_expr) + ort_string_len(fmt)); + CharKind* ret = (CharKind*) RTL_ALLOCA(oe_string_len(boolean_expr) + oe_string_len(fmt)); if (!ret) return ("?"); - const auto fmt_len = ort_string_len(fmt); - const auto res_len = ort_string_len(boolean_expr); + const auto fmt_len = oe_string_len(fmt); + const auto res_len = oe_string_len(boolean_expr); for (Size idx = 0; idx < fmt_len; ++idx) { if (fmt[idx] == '%') { @@ -135,9 +135,9 @@ inline const CharKind* KStringBuilder::FromBool(const CharKind* fmt, bool i) { } template inline bool KStringBuilder::Equals(const CharKind* lhs, const CharKind* rhs) { - if (ort_string_len(rhs) != ort_string_len(lhs)) return false; + if (oe_string_len(rhs) != oe_string_len(lhs)) return false; - for (Size index = 0; index < ort_string_len(rhs); ++index) { + for (Size index = 0; index < oe_string_len(rhs); ++index) { if (rhs[index] != lhs[index]) return false; } @@ -147,17 +147,17 @@ template inline const CharKind* KStringBuilder::Format(const CharKind* fmt, const CharKind* fmt2) { if (!fmt || !fmt2) return ("?"); - CharKind* ret = (CharKind*) RTL_ALLOCA(sizeof(char) * (ort_string_len(fmt2) + ort_string_len(fmt))); + CharKind* ret = (CharKind*) RTL_ALLOCA(sizeof(char) * (oe_string_len(fmt2) + oe_string_len(fmt))); if (!ret) return ("?"); - const auto len = ort_string_len(fmt); + const auto len = oe_string_len(fmt); for (Size idx = 0; idx < len; ++idx) { - if (fmt[idx] == '%' && idx < ort_string_len(fmt) && fmt[idx] == 's') { + if (fmt[idx] == '%' && idx < oe_string_len(fmt) && fmt[idx] == 's') { Size result_cnt = idx; - for (Size y_idx = 0; y_idx < ort_string_len(fmt2); ++y_idx) { + for (Size y_idx = 0; y_idx < oe_string_len(fmt2); ++y_idx) { ret[result_cnt] = fmt2[y_idx]; ++result_cnt; } -- cgit v1.2.3