summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/src/UtfUtils.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dev/kernel/src/UtfUtils.cc')
-rw-r--r--dev/kernel/src/UtfUtils.cc33
1 files changed, 33 insertions, 0 deletions
diff --git a/dev/kernel/src/UtfUtils.cc b/dev/kernel/src/UtfUtils.cc
new file mode 100644
index 00000000..db1dfaf4
--- /dev/null
+++ b/dev/kernel/src/UtfUtils.cc
@@ -0,0 +1,33 @@
+/* -------------------------------------------
+
+ Copyright (C) 2025, Amlal El Mahrouss, all rights reserved.
+
+------------------------------------------- */
+
+#include <NewKit/Utils.h>
+
+namespace Kernel {
+Size urt_string_len(const Utf8Char* str) {
+ SizeT len{0};
+
+ while (str[len] != u'\0') ++len;
+
+ return len;
+}
+
+Int urt_copy_memory(const voidPtr src, voidPtr dst, Size len) {
+ Utf8Char* srcChr = reinterpret_cast<Utf8Char*>(src);
+ Utf8Char* dstChar = reinterpret_cast<Utf8Char*>(dst);
+
+ Size index = 0;
+
+ while (index < len) {
+ dstChar[index] = srcChr[index];
+ ++index;
+ }
+
+ dstChar[index] = 0;
+
+ return index;
+}
+} // namespace Kernel \ No newline at end of file