OpenClonk
C4Value.h File Reference
Include dependency graph for C4Value.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

union  C4V_Data
 
class  C4JSONSerializationError
 
class  C4Value
 
class  C4ValueNumbers
 

Macros

#define C4V_Last   ((int) C4V_Array)
 
#define C4V_FirstPointer   C4V_PropList
 

Enumerations

enum  C4V_Type {
  C4V_Nil =0 , C4V_Int =1 , C4V_Bool =2 , C4V_PropList =3 ,
  C4V_String =4 , C4V_Array =5 , C4V_Function =6 , C4V_Enum =8 ,
  C4V_C4ObjectEnum =9 , C4V_Any , C4V_Object , C4V_Def ,
  C4V_Effect
}
 

Functions

const char * GetC4VName (const C4V_Type Type)
 
C4Value C4VInt (int32_t i)
 
C4Value C4VBool (bool b)
 
C4Value C4VObj (C4Object *pObj)
 
C4Value C4VPropList (C4PropList *p)
 
C4Value C4VString (C4String *pStr)
 
C4Value C4VString (StdStrBuf strString)
 
C4Value C4VString (const char *strString)
 
C4Value C4VArray (C4ValueArray *pArray)
 
C4Value C4VFunction (C4AulFunc *pFn)
 

Variables

const C4Value C4VNull
 

Macro Definition Documentation

◆ C4V_FirstPointer

#define C4V_FirstPointer   C4V_PropList

Definition at line 45 of file C4Value.h.

◆ C4V_Last

#define C4V_Last   ((int) C4V_Array)

Definition at line 43 of file C4Value.h.

Enumeration Type Documentation

◆ C4V_Type

enum C4V_Type
Enumerator
C4V_Nil 
C4V_Int 
C4V_Bool 
C4V_PropList 
C4V_String 
C4V_Array 
C4V_Function 
C4V_Enum 
C4V_C4ObjectEnum 
C4V_Any 
C4V_Object 
C4V_Def 
C4V_Effect 

Definition at line 23 of file C4Value.h.

24 {
25  C4V_Nil=0,
26  C4V_Int=1,
27  C4V_Bool=2,
28  C4V_PropList=3,
29  C4V_String=4,
30  C4V_Array=5,
31  C4V_Function=6,
32 
33  C4V_Enum=8, // enumerated array or proplist
34  C4V_C4ObjectEnum=9, // enumerated object
35 
36  // for typechecks
37  C4V_Any,
38  C4V_Object,
39  C4V_Def,
40  C4V_Effect,
41 };
@ C4V_Function
Definition: C4Value.h:31
@ C4V_Int
Definition: C4Value.h:26
@ C4V_PropList
Definition: C4Value.h:28
@ C4V_Object
Definition: C4Value.h:38
@ C4V_Any
Definition: C4Value.h:37
@ C4V_Bool
Definition: C4Value.h:27
@ C4V_Def
Definition: C4Value.h:39
@ C4V_C4ObjectEnum
Definition: C4Value.h:34
@ C4V_Effect
Definition: C4Value.h:40
@ C4V_Array
Definition: C4Value.h:30
@ C4V_Nil
Definition: C4Value.h:25
@ C4V_String
Definition: C4Value.h:29
@ C4V_Enum
Definition: C4Value.h:33

Function Documentation

◆ C4VArray()

C4Value C4VArray ( C4ValueArray pArray)
inline

Definition at line 246 of file C4Value.h.

246 { return C4Value(pArray); }

References C4PropList::C4Value.

Referenced by C4EditCursor::PerformDuplication(), and C4AulCompiler::ConstexprEvaluator::visit().

Here is the caller graph for this function:

◆ C4VBool()

C4Value C4VBool ( bool  b)
inline

Definition at line 240 of file C4Value.h.

240 { return C4Value(b); }
#define b

References b, and C4PropList::C4Value.

Referenced by C4ValueGetCompiler::ProcessBool(), and C4AulCompiler::ConstexprEvaluator::visit().

Here is the caller graph for this function:

◆ C4VFunction()

C4Value C4VFunction ( C4AulFunc pFn)
inline

Definition at line 247 of file C4Value.h.

247 { return C4Value(pFn); }

References C4PropList::C4Value.

Referenced by C4AulDefFunc::C4AulDefFunc(), C4AulEngineFunc< RType, ThisType, ParTypes >::C4AulEngineFunc(), C4ScriptHost::CopyPropList(), C4ScriptHost::UnlinkOwnedFunctions(), and C4AulCompiler::PreparseAstVisitor::visit().

Here is the caller graph for this function:

◆ C4VInt()

◆ C4VObj()

C4Value C4VObj ( C4Object pObj)

Definition at line 88 of file C4Value.cpp.

88 { return C4Value(static_cast<C4PropList*>(pObj)); }

Referenced by C4Object::AddObjectAndContentsToArray(), C4Game::CastObjects(), C4Landscape::P::DigMaterial2Objects(), C4ScriptGuiWindowAction::ExecuteCommand(), C4Command::Fail(), C4FindObject::FindMany(), C4EditCursor::PerformDuplication(), C4EditCursor::PerformDuplicationLegacy(), and C4EditCursor::SetHighlightedObject().

Here is the caller graph for this function:

◆ C4VPropList()

◆ C4VString() [1/3]

C4Value C4VString ( C4String pStr)
inline

Definition at line 243 of file C4Value.h.

243 { return C4Value(pStr); }

References C4PropList::C4Value.

Referenced by C4Game::AllocateTranslatedString(), C4Effect::C4Effect(), C4Effect::Check(), C4Command::Fail(), C4PropList::GetProperties(), C4Object::GetProperties(), C4Effect::GetProperties(), C4ValueGetCompiler::ProcessChar(), C4ValueGetCompiler::ProcessString(), C4PropList::SetName(), and C4AulCompiler::ConstexprEvaluator::visit().

Here is the caller graph for this function:

◆ C4VString() [2/3]

C4Value C4VString ( const char *  strString)
inline

Definition at line 245 of file C4Value.h.

245 { return C4Value(strString); }

References C4PropList::C4Value.

◆ C4VString() [3/3]

C4Value C4VString ( StdStrBuf  strString)
inline

Definition at line 244 of file C4Value.h.

244 { return C4Value(strString); }

References C4PropList::C4Value.

◆ GetC4VName()

const char* GetC4VName ( const C4V_Type  Type)

Definition at line 32 of file C4Value.cpp.

33 {
34  switch (Type)
35  {
36  case C4V_Nil:
37  return "nil";
38  case C4V_Int:
39  return "int";
40  case C4V_Bool:
41  return "bool";
42  case C4V_String:
43  return "string";
44  case C4V_Array:
45  return "array";
46  case C4V_PropList:
47  return "proplist";
48  case C4V_Any:
49  return "any";
50  case C4V_Object:
51  return "object";
52  case C4V_Def:
53  return "def";
54  case C4V_Effect:
55  return "effect";
56  case C4V_Function:
57  return "function";
58  default:
59  return "!Fehler!";
60  }
61 }

References C4V_Any, C4V_Array, C4V_Bool, C4V_Def, C4V_Effect, C4V_Function, C4V_Int, C4V_Nil, C4V_Object, C4V_PropList, and C4V_String.

Referenced by C4AulFunc::CheckParTypes(), and C4Value::GetTypeName().

Here is the caller graph for this function:

Variable Documentation

◆ C4VNull