diff options
| author | Amlal <amlal.elmahrouss@icloud.com> | 2025-01-24 10:38:36 +0100 |
|---|---|---|
| committer | Amlal <amlal.elmahrouss@icloud.com> | 2025-01-24 10:38:36 +0100 |
| commit | 7b4bd3577a31d0f0adc7371840642791ae1567f4 (patch) | |
| tree | 1a8afc973aaa739d0d763315cad2fd376d1cea9c /dev/Kernel/CFKit/Property.h | |
ADD: Open version, with important changes kept out.
Signed-off-by: Amlal <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Kernel/CFKit/Property.h')
| -rw-r--r-- | dev/Kernel/CFKit/Property.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/dev/Kernel/CFKit/Property.h b/dev/Kernel/CFKit/Property.h new file mode 100644 index 00000000..162b757b --- /dev/null +++ b/dev/Kernel/CFKit/Property.h @@ -0,0 +1,54 @@ +/* ------------------------------------------- + + Copyright (C) 2024, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifndef CFKIT_PROPS_H +#define CFKIT_PROPS_H + +#include <NewKit/Array.h> +#include <NewKit/Defines.h> +#include <NewKit/Function.h> +#include <NewKit/KString.h> + +#define kMaxPropLen 255 + +namespace CFKit +{ + using namespace Kernel; + + /// @brief handle to anything (number, ptr, string...) + using PropertyId = UIntPtr; + + /// @brief Kernel property class. + /// @example \Properties\SmpCores or \Properties\KernelVersion + class Property + { + public: + Property(); + virtual ~Property(); + + public: + Property& operator=(const Property&) = default; + Property(const Property&) = default; + + bool StringEquals(KString& name); + PropertyId& GetValue(); + KString& GetKey(); + + private: + KString fName{kMaxPropLen}; + PropertyId fValue{0UL}; + }; + + template <SizeT N> + using PropertyArray = Array<Property, N>; +} // namespace CFKit + +namespace Kernel +{ + using namespace CFKit; +} + +#endif // !CFKIT_PROPS_H |
