acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
property_set_papaya.h
1#pragma once
2
3
5
6
7namespace acme
8{
9
10
11 namespace ::property_set
12 {
13
14
15 inline bool get_string(string & strResult, const ::property_object& object, const ::scoped_string & scopedstrKey);
16 inline bool get_string(string & strResult, const ::property_object& object, string& strKey);
17 inline bool get_evaluation(string & strResult, const ::property_object& object, const ::scoped_string & scopedstrKey);
18 inline bool get_evaluation(string & strResult, const ::property_object& object, string& strKey);
19 inline bool get_evaluation(string & strResult, const ::property_set & set, string & strExpression);
20
21
22 inline string get_string(const ::property_set & set, const ::scoped_string & scopedstrKey)
23 {
24
25 return set[strKey];
26
27 }
28
29
30 //inline string get_string(const ::matter & matter, const ::scoped_string & scopedstrKey)
31 //{
32
33 // return matter.property_set_get_string(strKey);
34
35 //}
36
37
38 inline bool get_string(string & strResult, const ::property_set & set, const ::scoped_string & scopedstrKey)
39 {
40
41 return set.get_string(strResult, strKey);
42
43 }
44
45
46 inline bool get_evaluation(string & strResult, const ::property_set & set, const ::scoped_string & scopedstrExpression)
47 {
48
49 auto pproperty = set.find_property(strExpression);
50
51 if (::is_null(pproperty))
52 {
53
54 return false;
55
56 }
57
58 strResult = *pproperty;
59
60 return true;
61
62 }
63
64
65 inline bool get_evaluation(string & strResult, const ::property_set & set, string & strExpression)
66 {
67
68 return get_evaluation(strResult, set, (const string &) strExpression);
69
70 }
71
72
73 } // namespace ::property_set
74
75
76} // namespace acme
77
78
79
80
81#pragma once
82
83
84namespace acme
85{
86
87
88 namespace ::property_set
89 {
90
91
92 //inline string get_string(const ::property_set & set, const ::scoped_string & scopedstrKey)
93 //{
94
95 // return set[strKey].get_string();
96
97 //}
98
99
100 inline string get_string(const ::property_object & object, const ::scoped_string & scopedstrKey)
101 {
102
103 return object.property_set_get_string(strKey);
104
105 }
106
107
108 inline bool get_string(string & strResult, const ::property_object& object, const ::scoped_string & scopedstrKey)
109 {
110
111 return object.property_set_get_string(strResult, strKey);
112
113 }
114
115
116 inline bool get_string(string & strResult, const ::property_object& object, string& strKey)
117 {
118
119 return object.property_set_get_string(strResult, strKey);
120
121 }
122
123
124
125 inline bool get_evaluation(string & strResult, const ::property_object& object, const ::scoped_string & scopedstrKey)
126 {
127
128 return object.property_set_get_evaluation(strResult, strKey);
129
130 }
131
132
133 inline bool get_evaluation(string & strResult, const ::property_object& object, string& strKey)
134 {
135
136 return get_evaluation(strResult, object, (const string &)strKey);
137
138 }
139
140
141
142 //inline bool get_evaluation(string & strResult, const ::property_set & set, const ::scoped_string & scopedstrExpression)
143 //{
144
145 // auto pproperty = set.find_property(strExpression);
146
147 // if (::is_null(pproperty))
148 // {
149
150 // return false;
151
152 // }
153
154 // strResult = pproperty->get_string();
155
156 // return true;
157
158 //}
159
160
161 inline string get_evaluation(const ::property_object & object, const ::scoped_string & scopedstrExpression)
162 {
163
164 return object.property_set_get_evaluation(strExpression);
165
166 }
167
168
176 //template < typename PROPERTY_SOURCE >
177 //string evaluate(const PROPERTY_SOURCE & set, const ::scoped_string & scopedstrSource)
178 //{
179
180 // string str(strSource);
181
182 // character_count iPos;
183
184 // ::i8 ch;
185
186 // ::i8 chNext;
187
188 // for (iPos = 0; iPos < str.length(); iPos++)
189 // {
190
191 // ch = str[iPos];
192
193 // if (iPos + 1 < str.length())
194 // {
195
196 // chNext = str[iPos + 1];
197
198 // }
199 // else
200 // {
201
202 // chNext = '\0';
203
204 // }
205
206 // if (ch == '\\')
207 // {
208
209 // iPos++;
210
211 // continue;
212
213 // }
214 // else if (ch == '{' && chNext == '$')
215 // {
216
217 // character_count iEnd = str.find('}', iPos + 1);
218
219 // if (iEnd < 0)
220 // {
221
222 // //error
223
224 // break;
225
226 // }
227
228 // string strKey = str.substr(iPos + 2, iEnd - iPos - 2);
229
230 // string strEval;
231
232 // if (get_string(strEval, set, strKey))
233 // {
234
235 // str = str.left(iPos) + strEval + str.substr(iEnd + 1);
236
237 // iPos += strEval.length() - 1;
238
239 // }
240 // else
241 // {
242
243 // iPos = iEnd;
244
245 // }
246
247
248 // }
249 // else if (ch == '$')
250 // {
251
252 // if (!(ansi_char_isalpha(chNext) || chNext == '_'))
253 // {
254
255 // // error
256
257 // break;
258
259 // }
260
261 // character_count iStart = iPos;
262
263 // character_count iEnd = iStart + 2;
264
265 // for (; iEnd < str.length(); iEnd++)
266 // {
267
268 // ch = str[iEnd];
269
270 // if (!(ansi_char_isalpha(ch) || ch == '_' || ansi_char_isdigit(ch)))
271 // {
272
273 // break;
274
275 // }
276
277 // }
278
279 // string strExpression = str.substr(iStart, iEnd - iStart);
280
281 // string strEval;
282
283 // if (get_evaluation(strEval, set, strExpression))
284 // {
285
286 // str = str.left(iPos) + strEval + str.substr(iEnd);
287
288 // iPos += strEval.length() - 1;
289
290 // }
291 // else
292 // {
293
294 // iPos = iEnd;
295
296 // }
297
298 // }
299
300 // }
301
302 // return str;
303
304 //}
305
306
307
308
309 } // namespace ::property_set
310
311
312} // namespace acme
313
314
315
316
317
318
319
Definition property_object.h:21
include "aura/graphics/image/context.h"
Definition aaaa__defer.h:32