diff options
Diffstat (limited to 'public/frameworks/CoreFoundation.fwrk/headers/Dictionary.h')
| -rw-r--r-- | public/frameworks/CoreFoundation.fwrk/headers/Dictionary.h | 40 |
1 files changed, 40 insertions, 0 deletions
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 |
