diff options
Diffstat (limited to 'dev/kernel/CFKit/Property.h')
| -rw-r--r-- | dev/kernel/CFKit/Property.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/dev/kernel/CFKit/Property.h b/dev/kernel/CFKit/Property.h new file mode 100644 index 00000000..e4588ad6 --- /dev/null +++ b/dev/kernel/CFKit/Property.h @@ -0,0 +1,56 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, 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> +#include <CFKit/GUIDWrapper.h> + +#define kMaxPropLen (256U) + +namespace CFKit +{ + using namespace NeOS; + + /// @brief handle to anything (number, ptr, string...) + using PropertyId = UIntPtr; + + /// @brief Kernel property class. + /// @example /prop/smp_max or /prop/kern_ver + 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}; + Ref<XRN::GUID> fGUID{}; + }; + + template <SizeT N> + using PropertyArray = Array<Property, N>; +} // namespace CFKit + +namespace NeOS +{ + using namespace CFKit; +} + +#endif // !CFKIT_PROPS_H |
