OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
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

singleton  Nillable< T >
 
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

#define C4V_FirstPointer   C4V_PropList

Definition at line 45 of file C4Value.h.

#define C4V_Last   ((int) C4V_Array)

Definition at line 43 of file C4Value.h.

Enumeration Type Documentation

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 };

Function Documentation

C4Value C4VArray ( C4ValueArray pArray)
inline

Definition at line 249 of file C4Value.h.

References C4PropList::C4Value.

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

249 { return C4Value(pArray); }

Here is the caller graph for this function:

C4Value C4VBool ( bool  b)
inline

Definition at line 243 of file C4Value.h.

References C4PropList::C4Value.

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

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

Here is the caller graph for this function:

C4Value C4VFunction ( C4AulFunc pFn)
inline

Definition at line 250 of file C4Value.h.

References C4PropList::C4Value.

Referenced by C4AulDefFunc::C4AulDefFunc(), C4ScriptHost::CopyPropList(), C4ScriptHost::UnlinkOwnedFunctions(), and C4AulCompiler::PreparseAstVisitor::visit().

250 { return C4Value(pFn); }

Here is the caller graph for this function:

C4Value C4VObj ( C4Object pObj)

Definition at line 90 of file C4Value.cpp.

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

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

Here is the caller graph for this function:

C4Value C4VString ( C4String pStr)
inline

Definition at line 246 of file C4Value.h.

References C4PropList::C4Value.

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

246 { return C4Value(pStr); }

Here is the caller graph for this function:

C4Value C4VString ( StdStrBuf  strString)
inline

Definition at line 247 of file C4Value.h.

References C4PropList::C4Value.

247 { return C4Value(strString); }
C4Value C4VString ( const char *  strString)
inline

Definition at line 248 of file C4Value.h.

References C4PropList::C4Value.

248 { return C4Value(strString); }
const char* GetC4VName ( const C4V_Type  Type)

Definition at line 34 of file C4Value.cpp.

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(), C4Value::GetTypeName(), and C4AulCompiler::CodegenAstVisitor::visit().

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 }

Here is the caller graph for this function:

Variable Documentation