diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-09-04 11:54:55 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-04 11:54:55 +0200 |
| commit | 0f88e96c0cf7ffaccecae94794024164c510f735 (patch) | |
| tree | 66ebc7e2cb99a0e54ca7b2da4b617ceed6e98a3d /public/frameworks | |
| parent | aead694f3cada63e4dc2d79653a5b0efe0d9f49f (diff) | |
| parent | 77dc0a650819b460480e1c0be5409fc322a6d2a4 (diff) | |
Merge pull request #61 from nekernel-org/devv0.0.5
NeKernel: v0.0.5 (Arlington)
Diffstat (limited to 'public/frameworks')
| -rw-r--r-- | public/frameworks/CoreFoundation.fwrk/headers/Array.h | 2 | ||||
| -rw-r--r-- | public/frameworks/CoreFoundation.fwrk/headers/Dictionary.h | 40 |
2 files changed, 41 insertions, 1 deletions
diff --git a/public/frameworks/CoreFoundation.fwrk/headers/Array.h b/public/frameworks/CoreFoundation.fwrk/headers/Array.h index d9c528d9..81f5f064 100644 --- a/public/frameworks/CoreFoundation.fwrk/headers/Array.h +++ b/public/frameworks/CoreFoundation.fwrk/headers/Array.h @@ -46,7 +46,7 @@ class CFArray final { }; template <typename ValueType> -auto make_array(ValueType val) { +inline auto make_array(ValueType val) { return CFArray<ValueType, ARRAY_SIZE(val)>{val}; } } // namespace CF diff --git a/public/frameworks/CoreFoundation.fwrk/headers/Dictionary.h b/public/frameworks/CoreFoundation.fwrk/headers/Dictionary.h new file mode 100644 index 00000000..87496c73 --- /dev/null +++ b/public/frameworks/CoreFoundation.fwrk/headers/Dictionary.h @@ -0,0 +1,40 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include <libSystem/SystemKit/System.h> + +namespace CF { +template <typename Key, typename Value> +class CFDictionary final { + public: + explicit CFDictionary() = default; + ~CFDictionary() = default; + + CFDictionary& operator=(const CFDictionary&) = default; + CFDictionary(const CFDictionary&) = default; + + Value& operator[](Key& at) { + MUST_PASS(this->Find(at)); + return fArray[at]; + } + + Bool Empty() { return this->fCount > 0; } + + Bool Find(Key& key) { return No; } + + operator bool() { return !this->Empty(); } + + private: + SizeT fCount{0UL}; +}; + +template <typename KeyType, typename ValueType> +inline auto make_dict() { + return CFDictionary<KeyType, ValueType>{}; +} +} // namespace CF |
