OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4Value.cpp
Go to the documentation of this file.
1 /*
2  * OpenClonk, http://www.openclonk.org
3  *
4  * Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de/
5  * Copyright (c) 2009-2016, The OpenClonk Team and contributors
6  *
7  * Distributed under the terms of the ISC license; see accompanying file
8  * "COPYING" for details.
9  *
10  * "Clonk" is a registered trademark of Matthes Bender, used with permission.
11  * See accompanying file "TRADEMARK" for details.
12  *
13  * To redistribute this file separately, substitute the full license texts
14  * for the above references.
15  */
16 
17 #include "C4Include.h"
18 #include "script/C4Value.h"
19 
20 #include "script/C4AulExec.h"
21 #include "object/C4Def.h"
22 #include "object/C4DefList.h"
23 #include "script/C4StringTable.h"
24 #include "script/C4ValueArray.h"
25 #include "game/C4Game.h"
26 #include "game/C4GameScript.h"
27 #include "object/C4GameObjects.h"
28 #include "object/C4Object.h"
29 #include "lib/C4Log.h"
30 #include "script/C4Effect.h"
31 
33 
34 const char* GetC4VName(const C4V_Type Type)
35 {
36  switch (Type)
37  {
38  case C4V_Nil:
39  return "nil";
40  case C4V_Int:
41  return "int";
42  case C4V_Bool:
43  return "bool";
44  case C4V_String:
45  return "string";
46  case C4V_Array:
47  return "array";
48  case C4V_PropList:
49  return "proplist";
50  case C4V_Any:
51  return "any";
52  case C4V_Object:
53  return "object";
54  case C4V_Def:
55  return "def";
56  case C4V_Effect:
57  return "effect";
58  case C4V_Function:
59  return "function";
60  default:
61  return "!Fehler!";
62  }
63 }
64 
66 C4Value::C4Value(C4Def * p): C4Value(static_cast<C4PropList *>(p)) {}
67 C4Value::C4Value(C4Object * p): C4Value(static_cast<C4PropList *>(p)) {}
68 C4Value::C4Value(C4Effect * p): C4Value(static_cast<C4PropList *>(p)) {}
69 
71 {
72  return CheckConversion(C4V_Object) ? Data.PropList->GetObject() : nullptr;
73 }
74 
76 {
77  return Data.PropList ? Data.PropList->GetObject() : nullptr;
78 }
79 
81 {
82  return CheckConversion(C4V_Def) ? Data.PropList->GetDef() : nullptr;
83 }
84 
86 {
87  return Data.PropList ? Data.PropList->GetDef() : nullptr;
88 }
89 
90 C4Value C4VObj(C4Object *pObj) { return C4Value(static_cast<C4PropList*>(pObj)); }
91 
92 bool C4Value::FnCnvObject() const
93 {
94  // try casting
95  if (Data.PropList->GetObject()) return true;
96  return false;
97 }
98 
99 bool C4Value::FnCnvDef() const
100 {
101  // try casting
102  if (Data.PropList->GetDef()) return true;
103  return false;
104 }
105 
106 bool C4Value::FnCnvEffect() const
107 {
108  // try casting
109  if (Data.PropList->GetEffect()) return true;
110  return false;
111 }
112 
114 {
115  switch (vtToType)
116  {
117  case C4V_Nil: return Type != C4V_Nil && Type != C4V_Any;
118  case C4V_Int: return Type != C4V_Int && Type != C4V_Nil && Type != C4V_Bool && Type != C4V_Any;
119  case C4V_Bool: return false;
120  case C4V_PropList: return Type != C4V_PropList && Type != C4V_Effect && Type != C4V_Def && Type != C4V_Object && Type != C4V_Nil && Type != C4V_Any;
121  case C4V_String: return Type != C4V_String && Type != C4V_Nil && Type != C4V_Any;
122  case C4V_Array: return Type != C4V_Array && Type != C4V_Nil && Type != C4V_Any;
123  case C4V_Function: return Type != C4V_Function && Type != C4V_Nil && Type != C4V_Any;
124  case C4V_Any: return false;
125  case C4V_Def: return Type != C4V_Def && Type != C4V_Object && Type != C4V_PropList && Type != C4V_Nil && Type != C4V_Any;
126  case C4V_Object: return Type != C4V_Object && Type != C4V_PropList && Type != C4V_Nil && Type != C4V_Any;
127  case C4V_Effect: return Type != C4V_Effect && Type != C4V_PropList && Type != C4V_Nil && Type != C4V_Any;
128  default: assert(!"C4Value::ConvertTo: impossible conversion target"); return false;
129  }
130 }
131 
132 // Humanreadable debug output
133 StdStrBuf C4Value::GetDataString(int depth, const C4PropListStatic *ignore_reference_parent) const
134 {
135  // ouput by type info
136  switch (GetType())
137  {
138  case C4V_Int:
139  return FormatString("%ld", static_cast<long>(Data.Int));
140  case C4V_Bool:
141  return StdStrBuf(Data ? "true" : "false");
142  case C4V_PropList:
143  {
144  if (Data.PropList == ScriptEngine.GetPropList())
145  return StdStrBuf("Global");
146  C4Object * Obj = Data.PropList->GetObject();
147  if (Obj == Data.PropList)
148  return FormatString("Object(%d)", Obj->Number);
149  const C4PropListStatic * Def = Data.PropList->IsStatic();
150  if (Def)
151  if (!ignore_reference_parent || Def->GetParent() != ignore_reference_parent)
152  return Def->GetDataString();
153  C4Effect * fx = Data.PropList->GetEffect();
154  StdStrBuf DataString;
155  DataString = (fx ? "effect {" : "{");
156  Data.PropList->AppendDataString(&DataString, ", ", depth, Def && ignore_reference_parent);
157  DataString.AppendChar('}');
158  return DataString;
159  }
160  case C4V_String:
161  return (Data.Str && Data.Str->GetCStr()) ? FormatString("\"%s\"", Data.Str->GetCStr()) : StdStrBuf("(nullstring)");
162  case C4V_Array:
163  {
164  if (depth <= 0 && Data.Array->GetSize())
165  {
166  return StdStrBuf("[...]");
167  }
168  StdStrBuf DataString;
169  DataString = "[";
170  for (int32_t i = 0; i < Data.Array->GetSize(); i++)
171  {
172  if (i) DataString.Append(", ");
173  DataString.Append(std::move(Data.Array->GetItem(i).GetDataString(depth - 1)));
174  }
175  DataString.AppendChar(']');
176  return DataString;
177  }
178  case C4V_Function:
179  return Data.Fn->GetFullName();
180  case C4V_Nil:
181  return StdStrBuf("nil");
182  default:
183  return StdStrBuf("-unknown type- ");
184  }
185 }
186 
187 // JSON serialization.
188 // Only plain data values can be serialized. Throws a C4JSONSerializationError
189 // when encountering values that cannot be represented in JSON or when the
190 // maximum depth is reached.
191 StdStrBuf C4Value::ToJSON(int depth, const C4PropListStatic *ignore_reference_parent) const
192 {
193  // ouput by type info
194  switch (GetType())
195  {
196  case C4V_Int:
197  return FormatString("%ld", static_cast<long>(Data.Int));
198  case C4V_Bool:
199  return StdStrBuf(Data ? "true" : "false");
200  case C4V_PropList:
201  {
202  const C4PropListStatic * Def = Data.PropList->IsStatic();
203  if (Def)
204  if (!ignore_reference_parent || Def->GetParent() != ignore_reference_parent)
205  return Def->ToJSON();
206  return Data.PropList->ToJSON(depth, Def && ignore_reference_parent);
207  }
208  case C4V_String:
209  if (Data.Str && Data.Str->GetCStr())
210  {
211  StdStrBuf str = Data.Str->GetData();
212  str.EscapeString();
213  str.Replace("\n", "\\n");
214  return FormatString("\"%s\"", str.getData());
215  }
216  else
217  {
218  return StdStrBuf("null");
219  }
220  case C4V_Array:
221  {
222  if (depth <= 0 && Data.Array->GetSize())
223  {
224  throw C4JSONSerializationError("maximum depth reached");
225  }
226  StdStrBuf DataString;
227  DataString = "[";
228  for (int32_t i = 0; i < Data.Array->GetSize(); i++)
229  {
230  if (i) DataString.Append(",");
231  DataString.Append(std::move(Data.Array->GetItem(i).ToJSON(depth - 1)));
232  }
233  DataString.AppendChar(']');
234  return DataString;
235  }
236  case C4V_Function:
237  throw C4JSONSerializationError("cannot serialize function");
238  case C4V_Nil:
239  return StdStrBuf("null");
240  default:
241  throw C4JSONSerializationError("unknown type");
242  }
243 }
244 
246 {
247  if (n <= LoadedValues.size())
248  return LoadedValues[n - 1];
249  LogF("ERROR: Value number %d is missing.", n);
250  return C4VNull;
251 }
252 
253 void C4Value::Denumerate(class C4ValueNumbers * numbers)
254 {
255  switch (Type)
256  {
257  case C4V_Enum:
258  Set(numbers->GetValue(Data.Int)); break;
259  case C4V_Array:
260  Data.Array->Denumerate(numbers); break;
261  case C4V_PropList:
262  // objects and effects are denumerated via the main object list
263  if (!Data.PropList->IsNumbered() && !Data.PropList->IsStatic())
264  Data.PropList->Denumerate(numbers);
265  break;
266  case C4V_C4ObjectEnum:
267  {
269  if (pObj)
270  // set
271  SetPropList(pObj);
272  else
273  {
274  // object: invalid value - set to zero
275  LogF("ERROR: Object number %d is missing.", int(Data.Int));
276  Set0();
277  }
278  }
279  default: break;
280  }
281 }
282 
284 {
285  for (std::vector<C4Value>::iterator i = LoadedValues.begin(); i != LoadedValues.end(); ++i)
286  i->Denumerate(this);
287 }
288 
290 {
291  // This is only used for C4Values containing pointers
292  // Assume that all pointers have the same size
293  if (ValueNumbers.find(v->GetData()) == ValueNumbers.end())
294  {
295  ValuesToSave.push_back(v);
296  ValueNumbers[v->GetData()] = ValuesToSave.size();
297  return ValuesToSave.size();
298  }
299  return ValueNumbers[v->GetData()];
300 }
301 
303 {
304  // Type
305  bool deserializing = pComp->isDeserializer();
306  char cC4VID;
307  if (!deserializing)
308  {
309  assert(Type != C4V_Nil || !Data);
310  switch (Type)
311  {
312  case C4V_Nil:
313  cC4VID = 'n'; break;
314  case C4V_Int:
315  cC4VID = 'i'; break;
316  case C4V_Bool:
317  cC4VID = 'b'; break;
318  case C4V_PropList:
319  if (getPropList()->IsStatic())
320  cC4VID = 'D';
321  else if (getPropList()->IsNumbered())
322  cC4VID = 'O';
323  else
324  cC4VID = 'E';
325  break;
326  case C4V_Array:
327  cC4VID = 'E'; break;
328  case C4V_Function:
329  cC4VID = 'D'; break;
330  case C4V_String:
331  cC4VID = 's'; break;
332  default:
333  assert(false);
334  }
335  }
336  pComp->Character(cC4VID);
337  // Data
338  int32_t iTmp;
339  switch (cC4VID)
340  {
341  case 'i':
342  iTmp = Data.Int;
343  pComp->Value(iTmp);
344  SetInt(iTmp);
345  break;
346 
347  case 'b':
348  iTmp = Data.Int;
349  pComp->Value(iTmp);
350  SetBool(!!iTmp);
351  break;
352 
353  case 'E':
354  if (!deserializing)
355  iTmp = numbers->GetNumberForValue(this);
356  pComp->Value(iTmp);
357  if (deserializing)
358  {
359  Data.Int = iTmp; // must be denumerated later
360  Type = C4V_Enum;
361  }
362  break;
363 
364  case 'O':
365  if (!deserializing)
367  pComp->Value(iTmp);
368  if (deserializing)
369  {
370  Data.Int = iTmp; // must be denumerated later
371  Type = C4V_C4ObjectEnum;
372  }
373  break;
374 
375  case 'D':
376  {
377  if (!pComp->isDeserializer())
378  {
379  const C4PropList * p = getPropList();
380  if (getFunction())
381  {
382  p = Data.Fn->Parent;
383  assert(p);
384  assert(p->GetFunc(Data.Fn->GetName()) == Data.Fn);
385  assert(p->IsStatic());
386  }
387  p->IsStatic()->RefCompileFunc(pComp, numbers);
388  if (getFunction())
389  {
391  StdStrBuf s; s.Ref(Data.Fn->GetName());
393  }
394  }
395  else
396  {
397  StdStrBuf s;
398  C4Value temp;
400  if (!::ScriptEngine.GetGlobalConstant(s.getData(), &temp))
401  pComp->excCorrupt("Cannot find global constant %s", s.getData());
402  while(pComp->Separator(StdCompiler::SEP_PART))
403  {
404  C4PropList * p = temp.getPropList();
405  if (!p)
406  pComp->excCorrupt("static proplist %s is not a proplist anymore", s.getData());
408  C4String * c4s = ::Strings.FindString(s.getData());
409  if (!c4s || !p->GetPropertyByS(c4s, &temp))
410  pComp->excCorrupt("Cannot find property %s in %s", s.getData(), GetDataString().getData());
411  }
412  Set(temp);
413  }
414  break;
415  }
416 
417  case 's':
418  {
419  StdStrBuf s;
420  if (!deserializing)
421  s = Data.Str->GetData();
422  pComp->Value(s);
423  if (deserializing)
425  break;
426  }
427 
428  // FIXME: remove these three once Game.txt were re-saved with current version
429  case 'c':
430  if (deserializing)
432  break;
433 
434  case 't':
435  if (deserializing)
437  break;
438 
439  case 'g':
440  if (deserializing)
442  break;
443 
444  case 'n':
445  case 'A': // compat with OC 5.1
446  if (deserializing)
447  Set0();
448  // doesn't have a value, so nothing to store
449  break;
450 
451  default:
452  // shouldn't happen
453  pComp->excCorrupt("unknown C4Value type tag '%c'", cC4VID);
454  break;
455  }
456 }
457 
459 {
460  // Type
461  bool deserializing = pComp->isDeserializer();
462  char cC4VID;
463  switch(v->GetType())
464  {
465  case C4V_PropList: cC4VID = 'p'; break;
466  case C4V_Array: cC4VID = 'a'; break;
467  default: assert(deserializing); break;
468  }
469  pComp->Character(cC4VID);
471  switch(cC4VID)
472  {
473  case 'p':
474  {
475  C4PropList * p = v->_getPropList();
476  pComp->Value(mkParAdapt(mkPtrAdaptNoNull(p), this));
477  if (deserializing) v->SetPropList(p);
478  }
479  break;
480  case 'a':
481  {
482  C4ValueArray * a = v->_getArray();
483  pComp->Value(mkParAdapt(mkPtrAdaptNoNull(a), this));
484  if (deserializing) v->SetArray(a);
485  }
486  break;
487  default:
488  pComp->excCorrupt("Unexpected character '%c'", cC4VID);
489  break;
490  }
492 }
493 
495 {
496  bool deserializing = pComp->isDeserializer();
497  bool fNaming = pComp->hasNaming();
498  if (deserializing)
499  {
500  uint32_t iSize;
501  if (!fNaming) pComp->Value(iSize);
502  // Read new
503  do
504  {
505  // No entries left to read?
506  if (!fNaming && !iSize--)
507  break;
508  // Read entries
509  try
510  {
511  LoadedValues.push_back(C4Value());
512  CompileValue(pComp, &LoadedValues.back());
513  }
514  catch (StdCompiler::NotFoundException *pEx)
515  {
516  // No value found: Stop reading loop
517  delete pEx;
518  break;
519  }
520  }
521  while (pComp->Separator(StdCompiler::SEP_SEP));
522  }
523  else
524  {
525  // Note: the list grows during this loop due to nested data structures.
526  // Data structures with loops are fine because the beginning of the loop
527  // will be found in the map and not saved again.
528  // This may still work with the binary compilers due to double-compiling
529  if (!fNaming)
530  {
531  int32_t iSize = ValuesToSave.size();
532  pComp->Value(iSize);
533  }
534  for(std::list<C4Value *>::iterator i = ValuesToSave.begin(); i != ValuesToSave.end(); ++i)
535  {
536  CompileValue(pComp, *i);
537  if (i != ValuesToSave.end()) pComp->Separator(StdCompiler::SEP_SEP);
538  }
539  }
540 }
541 
542 inline bool ComparisonImpl(const C4Value &Value1, const C4Value &Value2)
543 {
544  C4V_Type Type1 = Value1.GetType();
545  C4V_Data Data1 = Value1.GetData();
546  C4V_Type Type2 = Value2.GetType();
547  C4V_Data Data2 = Value2.GetData();
548  switch (Type1)
549  {
550  case C4V_Nil:
551  assert(!Data1);
552  return Type1 == Type2;
553  case C4V_Int:
554  case C4V_Bool:
555  return (Type2 == C4V_Int || Type2 == C4V_Bool) &&
556  Data1.Int == Data2.Int;
557  case C4V_PropList:
558  return Type1 == Type2 && *Data1.PropList == *Data2.PropList;
559  case C4V_String:
560  return Type1 == Type2 && Data1.Str == Data2.Str;
561  case C4V_Array:
562  return Type1 == Type2 &&
563  (Data1.Array == Data2.Array || *(Data1.Array) == *(Data2.Array));
564  case C4V_Function:
565  return Type1 == Type2 && Data1.Fn == Data2.Fn;
566  default:
567  assert(!"Unexpected C4Value type (denumeration missing?)");
568  return Data1 == Data2;
569  }
570 }
571 
572 bool C4Value::operator == (const C4Value& Value2) const
573 {
574  // recursion guard using a linked list of Seen structures on the stack
575  // NOT thread-safe
576  struct Seen
577  {
578  Seen *prev;
579  const C4Value *left;
580  const C4Value *right;
581  inline Seen(Seen *prev, const C4Value *left, const C4Value *right):
582  prev(prev), left(left), right(right) {}
583  inline bool operator == (const Seen& other)
584  {
585  return left == other.left && right == other.right;
586  }
587  inline bool recursion(Seen *new_top)
588  {
589  for (Seen *s = this; s; s = s->prev)
590  if (*s == *new_top)
591  return true;
592  return false;
593  }
594  inline Seen *first()
595  {
596  Seen *s = this;
597  while (s->prev) s = s->prev;
598  return s;
599  }
600  };
601  static Seen *top = nullptr;
602  Seen here(top, this, &Value2);
603 
604  bool recursion = top && top->recursion(&here);
605  if (recursion)
606  {
607  Seen *first = top->first();
608  // GetDataString is fine for circular values
609  LogF("Caught infinite recursion comparing %s and %s",
610  first->left->GetDataString().getData(),
611  first->right->GetDataString().getData());
612  return false;
613  }
614  top = &here;
615  bool result = ComparisonImpl(*this, Value2);
616  top = here.prev;
617  return result;
618 }
619 
620 bool C4Value::operator != (const C4Value& Value2) const
621 {
622  return !(*this == Value2);
623 }
624 
626 {
627  // Return type including types derived from prop list types (such as C4V_Def)
628  if (Type == C4V_PropList)
629  {
630  if (FnCnvEffect()) return C4V_Effect;
631  if (FnCnvObject()) return C4V_Object;
632  if (FnCnvDef()) return C4V_Def;
633  }
634  return Type;
635 }
636 
637 void C4Value::LogDeletedObjectWarning(C4PropList * p)
638 {
639  if (p->GetPropListNumbered())
640  LogF("Warning: using deleted object (#%d) (%s)!", p->GetPropListNumbered()->Number, p->GetName());
641  else
642  LogF("Warning: using deleted proplist %p (%s)!", static_cast<void*>(p), p->GetName());
644 }
const char * getData() const
Definition: StdBuf.h:450
StdStrBuf ToJSON(int depth=10, bool ignore_reference_parent=false) const
Definition: C4PropList.cpp:537
virtual bool Separator(Sep eSep=SEP_SEP)
Definition: StdCompiler.h:129
void Denumerate()
Definition: C4Value.cpp:283
StdStrBuf GetData() const
Definition: C4StringTable.h:50
C4V_Type
Definition: C4Value.h:23
virtual bool hasNaming()
Definition: StdCompiler.h:68
int Replace(const char *szOld, const char *szNew, size_t iStartSearch=0)
Definition: StdBuf.cpp:291
C4PropListStatic * GetPropList()
Definition: C4Aul.h:153
C4GameScriptHost GameScript
void excCorrupt(const char *szMessage,...)
Definition: StdCompiler.h:259
C4AulScriptEngine ScriptEngine
Definition: C4Globals.cpp:43
C4String * FindString(const char *strString) const
const char * GetName() const
Definition: C4AulFunc.h:57
C4AulFunc * GetFunc(C4PropertyName k) const
Definition: C4PropList.h:107
void Denumerate(C4ValueNumbers *)
void LogCallStack()
Definition: C4AulExec.cpp:98
const char * GetCStr() const
Definition: C4StringTable.h:49
C4String * RegString(StdStrBuf String)
static C4PropList * GetByNumber(int32_t iNumber)
Definition: C4PropList.cpp:75
C4AulFunc * Fn
Definition: C4Value.h:57
bool GetGlobalConstant(const char *szName, C4Value *pTargetValue)
C4V_Type GetTypeEx() const
Definition: C4Value.cpp:625
void Set0()
Definition: C4Value.h:336
void SetBool(bool b)
Definition: C4Value.h:137
C4String * Str
Definition: C4Value.h:55
virtual class C4PropListStatic * IsStatic()
Definition: C4PropList.h:87
C4AulExec AulExec
Definition: C4AulExec.cpp:33
StdStrBuf GetDataString(int depth=10, const class C4PropListStatic *ignore_reference_parent=nullptr) const
Definition: C4Value.cpp:133
void Set(const C4Value &nValue)
Definition: C4Value.h:134
#define a
C4Value()
Definition: C4Value.h:76
C4Value C4VObj(C4Object *pObj)
Definition: C4Value.cpp:90
virtual C4Object * GetObject()
Definition: C4PropList.cpp:644
const C4Value & GetItem(int32_t iElem) const
Definition: C4ValueArray.h:38
ALWAYS_INLINE bool CheckConversion(C4V_Type vtToType) const
Definition: C4Value.h:189
virtual C4Def const * GetDef() const
Definition: C4PropList.cpp:662
void SetString(C4String *Str)
Definition: C4Value.h:138
void AppendChar(char cChar)
Definition: StdBuf.h:596
C4ValueArray * _getArray() const
Definition: C4Value.h:127
void CompileFunc(StdCompiler *)
Definition: C4Value.cpp:494
virtual void Denumerate(C4ValueNumbers *)
Definition: C4PropList.cpp:351
bool operator!=(const C4Value &Value2) const
Definition: C4Value.cpp:620
void Denumerate(C4ValueNumbers *)
Definition: C4Value.cpp:253
uint32_t GetNumberForValue(C4Value *v)
Definition: C4Value.cpp:289
C4V_Type GetType() const
Definition: C4Value.h:161
intptr_t Int
Definition: C4Value.h:52
C4StringTable Strings
Definition: C4Globals.cpp:42
C4Object * _getObj() const
Definition: C4Value.cpp:75
virtual bool GetPropertyByS(const C4String *k, C4Value *pResult) const
Definition: C4PropList.cpp:734
void CompileValue(StdCompiler *, C4Value *)
Definition: C4Value.cpp:458
virtual const char * GetName() const
Definition: C4PropList.cpp:626
static bool WarnAboutConversion(C4V_Type Type, C4V_Type vtToType)
Definition: C4Value.cpp:113
C4Value ScenPropList
Definition: C4ScriptHost.h:163
void AppendDataString(StdStrBuf *out, const char *delim, int depth=3, bool ignore_reference_parent=false) const
Definition: C4PropList.cpp:519
C4Def * _getDef() const
Definition: C4Value.cpp:85
void Append(const char *pnData, size_t iChars)
Definition: StdBuf.h:527
StdPtrAdapt< T > mkPtrAdaptNoNull(T *&rpObj)
Definition: StdAdaptors.h:604
void RefCompileFunc(StdCompiler *pComp, C4ValueNumbers *numbers) const
Definition: C4PropList.cpp:240
Definition: C4Def.h:100
virtual StdStrBuf GetFullName() const
Definition: C4AulFunc.cpp:38
void SetArray(C4ValueArray *Array)
Definition: C4Value.h:139
C4Value ScenPrototype
Definition: C4ScriptHost.h:164
bool ComparisonImpl(const C4Value &Value1, const C4Value &Value2)
Definition: C4Value.cpp:542
const char * GetC4VName(const C4V_Type Type)
Definition: C4Value.cpp:34
void Value(const T &rStruct)
Definition: StdCompiler.h:171
void SetInt(int32_t i)
Definition: C4Value.h:136
int32_t GetSize() const
Definition: C4ValueArray.h:36
virtual C4Effect * GetEffect()
Definition: C4PropList.cpp:686
virtual bool isDeserializer()
Definition: StdCompiler.h:63
void Ref(const char *pnData)
Definition: StdBuf.h:463
virtual void Character(char &rChar)=0
const C4Value C4VNull
Definition: C4Value.cpp:32
C4Def * getDef() const
Definition: C4Value.cpp:80
StdParameterAdapt< T, P > mkParAdapt(T &&rObj, P &&rPar)
Definition: StdAdaptors.h:456
C4ValueArray * Array
Definition: C4Value.h:56
StdStrBuf ToJSON(int depth=10, const class C4PropListStatic *ignore_reference_parent=nullptr) const
Definition: C4Value.cpp:191
C4V_Data GetData() const
Definition: C4Value.h:160
void CompileFunc(StdCompiler *pComp, C4ValueNumbers *)
Definition: C4Value.cpp:302
C4PropListStatic * Parent
Definition: C4AulFunc.h:56
void SetPropList(C4PropList *PropList)
Definition: C4Value.h:141
virtual bool IsNumbered() const
Definition: C4PropList.h:90
const C4Value & GetValue(uint32_t)
Definition: C4Value.cpp:245
C4PropList * _getPropList() const
Definition: C4Value.h:129
virtual C4PropListNumbered * GetPropListNumbered()
Definition: C4PropList.cpp:680
void EscapeString()
Definition: StdBuf.h:677
bool LogF(const char *strMessage,...)
Definition: C4Log.cpp:253
bool operator==(const C4Value &Value2) const
Definition: C4Value.cpp:572
#define s
C4AulFunc * getFunction() const
Definition: C4Value.h:119
C4Object * getObj() const
Definition: C4Value.cpp:70
const C4PropListStatic * GetParent() const
Definition: C4PropList.h:272
int iSize
Definition: TstC4NetIO.cpp:35
StdStrBuf FormatString(const char *szFmt,...)
Definition: StdBuf.cpp:277
C4PropList * PropList
Definition: C4Value.h:54
StdStrBuf GetDataString() const
Definition: C4PropList.cpp:253
C4PropList * getPropList() const
Definition: C4Value.h:116