From 4c714f2c24c5df78bae2f35c42c73107de4c8c71 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 18 Mar 2024 12:35:19 +0100 Subject: 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 --- Private/NewBoot/Source/BootString.cxx | 61 +++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 Private/NewBoot/Source/BootString.cxx (limited to 'Private/NewBoot/Source/BootString.cxx') 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 + +/// 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; +} -- cgit v1.2.3