summaryrefslogtreecommitdiffhomepage
path: root/Private/Source/GUIDWizard.cxx
diff options
context:
space:
mode:
authorAmlal <amlalelmahrouss@icloud.com>2024-05-11 06:43:54 +0000
committerAmlal <amlalelmahrouss@icloud.com>2024-05-11 06:43:54 +0000
commitca675beb41dba8d7d16c5793b55d1672f38be3b4 (patch)
treec995ada42729ac2059a0ed87a4539d1a7e10b14a /Private/Source/GUIDWizard.cxx
parent2b4a4792abf51487ab4a16106f9376f43acf381a (diff)
parentbc57a29a24b98b00ba17710ba84ec2188ab73504 (diff)
Merged in MHR-23 (pull request #12)
MHR-23: Merge work.
Diffstat (limited to 'Private/Source/GUIDWizard.cxx')
-rw-r--r--Private/Source/GUIDWizard.cxx58
1 files changed, 0 insertions, 58 deletions
diff --git a/Private/Source/GUIDWizard.cxx b/Private/Source/GUIDWizard.cxx
deleted file mode 100644
index 9d0d4f35..00000000
--- a/Private/Source/GUIDWizard.cxx
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -------------------------------------------
-
- Copyright Mahrouss Logic
-
- File: GUIDWizard.cxx
- Purpose: GUID helper code
-
- Revision History:
-
-------------------------------------------- */
-
-#include <CFKit/GUIDWizard.hpp>
-#include <NewKit/Ref.hpp>
-
-// begin of ascii 'readable' characters. (A, C, C, 1, 2)
-#define kAsciiBegin 47
-// @brief Size of UUID.
-#define kUUIDSize 37
-
-namespace NewOS::XRN::Version1 {
-auto make_sequence(const ArrayList<UShort>& uuidSeq) -> Ref<GUIDSequence*> {
- GUIDSequence* seq = new GUIDSequence();
- MUST_PASS(seq);
-
- Ref<GUIDSequence*> sequenceReference{seq, true};
-
- sequenceReference->fMs1 |= uuidSeq[0];
- sequenceReference->fMs2 |= uuidSeq[1];
- sequenceReference->fMs3 |= uuidSeq[2];
- sequenceReference->fMs3 |= uuidSeq[3];
-
- return sequenceReference;
-}
-
-// @brief Tries to make a guid out of a string.
-// This function is not complete for now
-auto try_guid_to_string(Ref<GUIDSequence*>& seq) -> ErrorOr<Ref<StringView>> {
- Char buf[kUUIDSize];
-
- for (SizeT index = 0; index < 16; ++index) {
- buf[index] = seq->u8[index] + kAsciiBegin;
- }
-
- for (SizeT index = 16; index < 24; ++index) {
- buf[index] = seq->u16[index] + kAsciiBegin;
- }
-
- for (SizeT index = 24; index < 28; ++index) {
- buf[index] = seq->u32[index] + kAsciiBegin;
- }
-
- auto view = StringBuilder::Construct(buf);
-
- if (view) return ErrorOr<Ref<StringView>>{view.Leak()};
-
- return ErrorOr<Ref<StringView>>{-1};
-}
-} // namespace NewOS::XRN::Version1