blob: 25685b0390c2c3cdd5e940bb670be37d9cc403b9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
/* -------------------------------------------
Copyright (C) 2024, t& Corporation, 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
|