summaryrefslogtreecommitdiffhomepage
path: root/Private/NewBoot/Source/BootString.cxx
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@el-mahrouss-logic.com>2024-03-18 12:35:19 +0100
committerAmlal El Mahrouss <amlal@el-mahrouss-logic.com>2024-03-18 12:39:24 +0100
commit4c714f2c24c5df78bae2f35c42c73107de4c8c71 (patch)
treeb36d2498b8387909dac45c98097b8169636ad25a /Private/NewBoot/Source/BootString.cxx
parenta4bfc396a78ddd553de519ab927d8479d0c3c45d (diff)
unstable, unrelated: See below.
- :boom: Breaking changes in System.Core.dll - Framebuffer, moved operator bool into c++ source file. - Remove zlib in favor of our own Zip API. Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Private/NewBoot/Source/BootString.cxx')
-rw-r--r--Private/NewBoot/Source/BootString.cxx61
1 files changed, 61 insertions, 0 deletions
diff --git a/Private/NewBoot/Source/BootString.cxx b/Private/NewBoot/Source/BootString.cxx
new file mode 100644
index 00000000..9fbe1a11
--- /dev/null
+++ b/Private/NewBoot/Source/BootString.cxx
@@ -0,0 +1,61 @@
+/* -------------------------------------------
+
+ Copyright Mahrouss Logic
+
+ File: String.cxx
+ Purpose: NewBoot string library
+
+ Revision History:
+
+
+
+------------------------------------------- */
+
+#include <BootKit/BootKit.hxx>
+
+/// bugs 0
+
+/////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+HCore::SizeT BCopyMem(CharacterType *dest, CharacterType *src,
+ const HCore::SizeT len) {
+ if (!dest || !src) return 0;
+
+ SizeT index = 0UL;
+ for (; index < len; ++index) {
+ dest[index] = src[index];
+ }
+
+ return index;
+}
+
+HCore::SizeT BStrLen(const CharacterType *ptr) {
+ if (!ptr) return 0;
+
+ HCore::SizeT cnt = 0;
+
+ while (*ptr != (CharacterType)0) {
+ ++ptr;
+ ++cnt;
+ }
+
+ return cnt;
+}
+
+HCore::SizeT BSetMem(CharacterType *src, const CharacterType byte,
+ const HCore::SizeT len) {
+ if (!src) return 0;
+
+ HCore::SizeT cnt = 0UL;
+
+ while (*src != 0) {
+ if (cnt > len) break;
+
+ *src = byte;
+ ++src;
+
+ ++cnt;
+ }
+
+ return cnt;
+}