blob: 58e881e57b9af403581c7d7efb04e6b1c66fb242 (
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
|
/* -------------------------------------------
Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved.
------------------------------------------- */
#ifndef _PROPS_H
#define _PROPS_H
#include <CoreFoundation.fwrk/headers/Ref.h>
#include <user/SystemCalls.h>
#define kMaxPropLen (256U)
namespace CF {
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 final CF_OBJECT {
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 CF
#endif // !CFKIT_PROPS_H
|