-
Notifications
You must be signed in to change notification settings - Fork 140
/
opennurbs_archivable_dictionary.h
165 lines (127 loc) · 7.17 KB
/
opennurbs_archivable_dictionary.h
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
//
// Copyright (c) 1993-2022 Robert McNeel & Associates. All rights reserved.
// OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
// McNeel & Associates.
//
// THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
// ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
// MERCHANTABILITY ARE HEREBY DISCLAIMED.
//
// For complete openNURBS copyright information see <http://www.opennurbs.org>.
//
////////////////////////////////////////////////////////////////
#if !defined(OPENNURBS_ARCHIVABLE_DICTIONARY_INC_)
#define OPENNURBS_ARCHIVABLE_DICTIONARY_INC_
class ON_CLASS ON_ArchivableDictionary
{
public:
static const ON_ArchivableDictionary Empty;
ON_ArchivableDictionary();
virtual ~ON_ArchivableDictionary();
ON_ArchivableDictionary(const ON_ArchivableDictionary& src);
ON_ArchivableDictionary& operator=(const ON_ArchivableDictionary& src);
#if defined(ON_HAS_RVALUEREF)
ON_ArchivableDictionary(ON_ArchivableDictionary&& src) ON_NOEXCEPT;
ON_ArchivableDictionary& operator=(ON_ArchivableDictionary&& src) ON_NOEXCEPT;
#endif
virtual bool Write(ON_BinaryArchive& binary_archive) const;
virtual bool Read(ON_BinaryArchive& binary_archive);
int Count() const; // Number of elements in dictionary.
void Clear(); // Sets count to 0.
ON_ClassArray<ON_wString> GetKeys() const;
bool ContainsKey(const wchar_t* key) const;
bool Remove(const wchar_t* key);
bool CopyValue(const wchar_t* key, const ON_ArchivableDictionary& source, const wchar_t* source_key = nullptr);
void CopyValues(const ON_ArchivableDictionary& source);
#pragma region Getters-Setters Primitives
bool TrySetBool(const wchar_t* key, bool value);
bool TryGetBool(const wchar_t* key, bool& value) const;
void SetBool(const wchar_t* key, bool value);
bool GetBool(const wchar_t* key) const;
bool TrySetUInt8(const wchar_t* key, ON__UINT8 value);
bool TryGetUInt8(const wchar_t* key, ON__UINT8& value) const;
void SetUInt8(const wchar_t* key, ON__UINT8 value);
ON__UINT8 GetUInt8(const wchar_t* key) const;
bool TrySetInt8(const wchar_t* key, ON__INT8 value);
bool TryGetInt8(const wchar_t* key, ON__INT8& value) const;
void SetInt8(const wchar_t* key, ON__INT8 value);
ON__INT8 GetInt8(const wchar_t* key) const;
bool TrySetInt16(const wchar_t* key, ON__INT16 value);
bool TryGetInt16(const wchar_t* key, ON__INT16& value) const;
void SetInt16(const wchar_t* key, ON__INT16 value);
ON__INT16 GetInt16(const wchar_t* key) const;
bool TrySetInt32(const wchar_t* key, ON__INT32 value);
bool TryGetInt32(const wchar_t* key, ON__INT32& value) const;
void SetInt32(const wchar_t* key, ON__INT32 value);
ON__INT32 GetInt32(const wchar_t* key) const;
bool TrySetInt64(const wchar_t* key, ON__INT64 value);
bool TryGetInt64(const wchar_t* key, ON__INT64& value) const;
void SetInt64(const wchar_t* key, ON__INT64 value);
ON__INT64 GetInt64(const wchar_t* key) const;
bool TrySetFloat(const wchar_t* key, float value);
bool TryGetFloat(const wchar_t* key, float& value) const;
void SetFloat(const wchar_t* key, float value);
float GetFloat(const wchar_t* key) const;
bool TrySetDouble(const wchar_t* key, double value);
bool TryGetDouble(const wchar_t* key, double& value) const;
void SetDouble(const wchar_t* key, double value);
double GetDouble(const wchar_t* key) const;
bool TrySetUuid(const wchar_t* key, ON_UUID value);
bool TryGetUuid(const wchar_t* key, ON_UUID& value) const;
void SetUuid(const wchar_t* key, ON_UUID value);
ON_UUID GetUuid(const wchar_t* key) const;
bool TrySetString(const wchar_t* key, const ON_wString& value);
bool TryGetString(const wchar_t* key, ON_wString& value) const;
void SetString(const wchar_t* key, const ON_wString& value);
ON_wString GetString(const wchar_t* key) const;
#pragma endregion
#pragma region Getters-Setters Primitive Arrays
bool TrySetBoolArray(const wchar_t* key, const ON_SimpleArray<bool>& value);
bool TryGetBoolArray(const wchar_t* key, ON_SimpleArray<bool>& value) const;
void SetBoolArray(const wchar_t* key, const ON_SimpleArray<bool>& value);
ON_SimpleArray<bool> GetBoolArray(const wchar_t* key) const;
bool TrySetUInt8Array(const wchar_t* key, const ON_SimpleArray<ON__UINT8>& value);
bool TryGetUInt8Array(const wchar_t* key, ON_SimpleArray<ON__UINT8>& value) const;
void SetUInt8Array(const wchar_t* key, const ON_SimpleArray<ON__UINT8>& value);
ON_SimpleArray<ON__UINT8> GetUInt8Array(const wchar_t* key) const;
bool TrySetInt8Array(const wchar_t* key, const ON_SimpleArray<ON__INT8>& value);
bool TryGetInt8Array(const wchar_t* key, ON_SimpleArray<ON__INT8>& value) const;
void SetInt8Array(const wchar_t* key, const ON_SimpleArray<ON__INT8>& value);
ON_SimpleArray<ON__INT8> GetInt8Array(const wchar_t* key) const;
bool TrySetInt16Array(const wchar_t* key, const ON_SimpleArray<ON__INT16>& value);
bool TryGetInt16Array(const wchar_t* key, ON_SimpleArray<ON__INT16>& value) const;
void SetInt16Array(const wchar_t* key, const ON_SimpleArray<ON__INT16>& value);
ON_SimpleArray<ON__INT16> GetInt16Array(const wchar_t* key) const;
bool TrySetInt32Array(const wchar_t* key, const ON_SimpleArray<ON__INT32>& value);
bool TryGetInt32Array(const wchar_t* key, ON_SimpleArray<ON__INT32>& value) const;
void SetInt32Array(const wchar_t* key, const ON_SimpleArray<ON__INT32>& value);
ON_SimpleArray<ON__INT32> GetInt32Array(const wchar_t* key) const;
bool TrySetFloatArray(const wchar_t* key, const ON_SimpleArray<float>& value);
bool TryGetFloatArray(const wchar_t* key, ON_SimpleArray<float>& value) const;
void SetFloatArray(const wchar_t* key, const ON_SimpleArray<float>& value);
ON_SimpleArray<float> GetFloatArray(const wchar_t* key) const;
bool TrySetDoubleArray(const wchar_t* key, const ON_SimpleArray<double>& value);
bool TryGetDoubleArray(const wchar_t* key, ON_SimpleArray<double>& value) const;
void SetDoubleArray(const wchar_t* key, const ON_SimpleArray<double>& value);
ON_SimpleArray<double> GetDoubleArray(const wchar_t* key) const;
bool TrySetUuidArray(const wchar_t* key, const ON_SimpleArray<ON_UUID>& value);
bool TryGetUuidArray(const wchar_t* key, ON_SimpleArray<ON_UUID>& value) const;
void SetUuidArray(const wchar_t* key, const ON_SimpleArray<ON_UUID>& value);
ON_SimpleArray<ON_UUID> GetUuidArray(const wchar_t* key) const;
bool TrySetStringArray(const wchar_t* key, const ON_ClassArray<ON_wString>& value);
bool TryGetStringArray(const wchar_t* key, ON_ClassArray<ON_wString>& value) const;
void SetStringArray(const wchar_t* key, const ON_ClassArray<ON_wString>& value);
ON_ClassArray<ON_wString> GetStringArray(const wchar_t* key) const;
#pragma endregion
#pragma region Getters-Setters Geometry
bool TrySetMeshParameters(const wchar_t* key, const ON_MeshParameters& value);
bool TryGetMeshParameters(const wchar_t* key, ON_MeshParameters& value) const;
void SetMeshParameters(const wchar_t* key, const ON_MeshParameters& value);
ON_MeshParameters GetMeshParameters(const wchar_t* key) const;
#pragma endregion
private:
class ON_ArchivableDictionaryPrivate* m_private = nullptr;
ON__UINT_PTR m_reserved = 0;
};
////////////////////////////////////////////////////////////////
#endif