blob: 283159389536447e090d864e999899956061aa4b (
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
|
/* ========================================
Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
======================================== */
#pragma once
#include <CoreFoundation.fwrk/headers/Foundation.h>
#include <CoreFoundation.fwrk/headers/Ref.h>
#include <libSystem/SystemKit/System.h>
#define kCFMaxPropLen (256U)
namespace CF {
class CFString;
class CFProperty;
template <typename Cls, SizeT N>
class CFArray;
/// ================================================================================
/// @brief handle to anything (number, ptr, string...)
/// ================================================================================
using CFPropertyId = UIntPtr;
/// ================================================================================
/// @brief User property class.
/// @note /prop/foo or /prop/bar are properties.
/// ================================================================================
class CFProperty final CF_OBJECT {
public:
CFProperty(CFRef<CFGuid> guid, CFString& name, CFPropertyId value);
~CFProperty() override = default;
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};
CFRef<CFGuid> fGUID{};
};
template <SizeT N>
using CFPropertyArray = CFArray<CFProperty, N>;
} // namespace CF
|