diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-02-11 08:51:02 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-02-11 08:51:02 +0100 |
| commit | f511ab3c1e840e1568dec67c4988f42e67d527b7 (patch) | |
| tree | 7ee9decdcc95c43d41d6d6e289e8bc4cc116888f /dev/Usr/LibCF/Property.h | |
| parent | 5a221a0ba51b55e671efac8f8708a4ab28414816 (diff) | |
ADD: LibCF
Diffstat (limited to 'dev/Usr/LibCF/Property.h')
| -rw-r--r-- | dev/Usr/LibCF/Property.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/dev/Usr/LibCF/Property.h b/dev/Usr/LibCF/Property.h new file mode 100644 index 00000000..629dba27 --- /dev/null +++ b/dev/Usr/LibCF/Property.h @@ -0,0 +1,53 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifndef CFKIT_PROPS_H +#define CFKIT_PROPS_H + +#include <LibSCI/SCI.h> +#include <LibCF/Ref.h> + +#define kMaxPropLen (256U) + +namespace LibCF +{ + class CFString; + class CFProperty; + class CFGUID; + + template<typename Cls, SizeT N> + class CFArray; + + /// @brief handle to anything (number, ptr, string...) + using CFPropertyId = UIntPtr; + + /// @brief User property class. + /// @example /prop/foo or /prop/bar + class CFProperty + { + public: + CFProperty(); + virtual ~CFProperty(); + + public: + CFProperty& operator=(const CFProperty&) = default; + CFProperty(const CFProperty&) = default; + + Bool StringEquals(CFString& name); + CFPropertyId& GetValue(); + CFString& GetKey(); + + private: + CFString* fName{nullptr}; + CFPropertyId fValue{0UL}; + Ref<CFGUID> fGUID{}; + }; + + template <SizeT N> + using CFPropertyArray = CFArray<CFProperty, N>; +} // namespace CFKit + +#endif // !CFKIT_PROPS_H |
