#include <C4Value.h>
Public Member Functions | |
C4Value () | |
C4Value (const C4Value &nValue) | |
C4Value (C4Value &&nValue) noexcept | |
C4Value (bool data) | |
C4Value (int data) | |
C4Value (long data) | |
C4Value (C4PropListStatic *p) | |
C4Value (C4Def *p) | |
C4Value (C4Object *pObj) | |
C4Value (C4Effect *p) | |
C4Value (C4String *pStr) | |
C4Value (const char *s) | |
C4Value (const StdStrBuf &s) | |
C4Value (C4ValueArray *pArray) | |
C4Value (C4AulFunc *pFn) | |
C4Value (C4PropList *p) | |
C4Value (C4ObjectPtr p) | |
template<typename T > | |
C4Value (Nillable< T > v) | |
C4Value & | operator= (const C4Value &nValue) |
~C4Value () | |
int32_t | getInt () const |
bool | getBool () const |
C4Object * | getObj () const |
C4Def * | getDef () const |
C4PropList * | getPropList () const |
C4String * | getStr () const |
C4ValueArray * | getArray () const |
C4AulFunc * | getFunction () const |
int32_t | _getInt () const |
bool | _getBool () const |
C4Object * | _getObj () const |
C4Def * | _getDef () const |
C4String * | _getStr () const |
C4ValueArray * | _getArray () const |
C4AulFunc * | _getFunction () const |
C4PropList * | _getPropList () const |
bool | operator! () const |
operator const void * () const | |
void | Set (const C4Value &nValue) |
void | SetInt (int32_t i) |
void | SetBool (bool b) |
void | SetString (C4String *Str) |
void | SetArray (C4ValueArray *Array) |
void | SetFunction (C4AulFunc *Fn) |
void | SetPropList (C4PropList *PropList) |
void | SetObjectEnum (int i) |
void | Set0 () |
bool | operator== (const C4Value &Value2) const |
bool | operator!= (const C4Value &Value2) const |
bool | IsIdenticalTo (const C4Value &cmp) const |
C4Value & | operator+= (int32_t by) |
C4Value & | operator++ () |
C4Value | operator++ (int) |
C4Value & | operator-- () |
C4Value | operator-- (int) |
C4V_Data | GetData () const |
C4V_Type | GetType () const |
C4V_Type | GetTypeEx () const |
const char * | GetTypeName () const |
void | Denumerate (C4ValueNumbers *) |
StdStrBuf | GetDataString (int depth=10, const class C4PropListStatic *ignore_reference_parent=nullptr) const |
StdStrBuf | ToJSON (int depth=10, const class C4PropListStatic *ignore_reference_parent=nullptr) const |
ALWAYS_INLINE bool | CheckParConversion (C4V_Type vtToType) const |
ALWAYS_INLINE bool | CheckConversion (C4V_Type vtToType) const |
void | CompileFunc (StdCompiler *pComp, C4ValueNumbers *) |
Static Public Member Functions | |
static bool | WarnAboutConversion (C4V_Type Type, C4V_Type vtToType) |
static constexpr bool | IsNullableType (C4V_Type Type) |
Friends | |
class | C4PropList |
|
inline |
|
noexcept |
|
inlineexplicit |
|
inlineexplicit |
Definition at line 84 of file C4Value.h.
References C4V_Data::Int.
|
inlineexplicit |
Definition at line 86 of file C4Value.h.
References C4V_Data::Int.
|
explicit |
Definition at line 63 of file C4Value.cpp.
|
explicit |
Definition at line 64 of file C4Value.cpp.
|
explicit |
Definition at line 65 of file C4Value.cpp.
|
explicit |
Definition at line 66 of file C4Value.cpp.
|
inlineexplicit |
|
inlineexplicit |
Definition at line 94 of file C4Value.h.
References C4StringTable::RegString(), s, C4V_Data::Str, and Strings.
|
inlineexplicit |
Definition at line 96 of file C4Value.h.
References C4StringTable::RegString(), s, C4V_Data::Str, and Strings.
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inline |
|
inline |
Definition at line 105 of file C4Value.h.
|
inline |
|
inline |
Definition at line 127 of file C4Value.h.
References C4V_Data::Array.
Referenced by C4ValueConv< C4ValueArray * >::_FromC4V(), C4ValueNumbers::CompileValue(), C4ValueArraySortArrayElementcomp::operator()(), and C4ValueArray::SetSlice().
|
inline |
Definition at line 123 of file C4Value.h.
References C4V_Data::Int.
Referenced by C4ValueConv< bool >::_FromC4V().
C4Def * C4Value::_getDef | ( | ) | const |
Definition at line 83 of file C4Value.cpp.
References C4PropList::GetDef(), and C4V_Data::PropList.
Referenced by C4ValueConv< C4Def * >::_FromC4V().
|
inline |
Definition at line 128 of file C4Value.h.
References C4V_Data::Fn.
Referenced by C4ValueConv< C4AulFunc * >::_FromC4V().
|
inline |
Definition at line 122 of file C4Value.h.
References C4V_Data::Int.
Referenced by C4ValueConv< int >::_FromC4V(), C4Command::Acquire(), C4Command::Activate(), C4Command::CallFailed(), C4Game::CompileFunc(), C4Command::Dig(), C4Object::Draw(), C4Command::Drop(), C4Command::FlightControl(), C4Command::Get(), C4Command::Grab(), C4Command::InitEvaluation(), C4Command::Jump(), C4Command::JumpControl(), C4Command::MoveTo(), C4ValueArraySortcomp::operator()(), C4Command::PushTo(), C4Command::Put(), C4Command::Throw(), and C4AulCompiler::ConstexprEvaluator::visit().
C4Object * C4Value::_getObj | ( | ) | const |
Definition at line 73 of file C4Value.cpp.
References C4PropList::GetObject(), and C4V_Data::PropList.
Referenced by C4ValueConv< C4Object * >::_FromC4V(), C4SortObjectSTL::operator()(), and C4SortObjectByValue::PrepareCache().
|
inline |
Definition at line 129 of file C4Value.h.
References C4V_Data::PropList.
Referenced by C4ValueConv< C4PropList * >::_FromC4V(), C4ValueConv< C4Effect * >::_FromC4V(), C4GameScriptHost::Call(), C4ExtraScriptHost::Clear(), C4AulScriptEngine::CompileFunc(), C4Effect::CompileFunc(), C4ValueNumbers::CompileValue(), C4ScriptHost::CopyPropList(), C4SoundModifier::GetBoolProp(), C4Effect::GetCallbackScript(), C4SoundModifier::GetFloatProp(), C4ExtraScriptHost::GetPropList(), C4GameScriptHost::GetPropList(), C4SoundModifier::GetProps(), C4PropList::GetPrototype(), C4Game::GetTranslatedString(), C4Game::Init(), C4MapScriptHost::InitializeMap(), C4ValueArraySortPropertycomp::operator()(), C4MCOverlay::SetField(), and C4Console::UpdateInputCtrl().
|
inline |
Definition at line 126 of file C4Value.h.
References C4V_Data::Str.
Referenced by C4ValueConv< C4String * >::_FromC4V(), C4Game::GetTranslatedString(), C4ValueArraySortStringscomp::operator()(), and C4ValueArraySortcomp::operator()().
|
inline |
Definition at line 189 of file C4Value.h.
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 getArray(), getBool(), getDef(), getFunction(), getInt(), getObj(), getPropList(), getStr(), C4ValueArraySortcomp::operator()(), C4Command::Set(), and C4AulCompiler::ConstexprEvaluator::visit().
|
inline |
Definition at line 171 of file C4Value.h.
References C4V_Any, C4V_Array, C4V_Bool, C4V_Def, C4V_Effect, C4V_Function, C4V_Int, C4V_Nil, C4V_Object, C4V_PropList, and C4V_String.
void C4Value::CompileFunc | ( | StdCompiler * | pComp, |
C4ValueNumbers * | numbers | ||
) |
Definition at line 300 of file C4Value.cpp.
References C4V_Array, C4V_Bool, C4V_C4ObjectEnum, C4V_Enum, C4V_Function, C4V_Int, C4V_Nil, C4V_PropList, C4V_String, StdCompiler::Character(), StdCompiler::excCorrupt(), C4StringTable::FindString(), C4V_Data::Fn, GameScript, C4String::GetData(), GetDataString(), C4PropList::GetFunc(), getFunction(), C4AulScriptEngine::GetGlobalConstant(), C4AulFunc::GetName(), C4ValueNumbers::GetNumberForValue(), C4PropList::GetPropertyByS(), C4AulScriptEngine::GetPropList(), getPropList(), C4PropList::GetPropListNumbered(), C4V_Data::Int, StdCompiler::isDeserializer(), C4PropList::IsStatic(), mkParAdapt(), C4PropListNumbered::Number, C4AulFunc::Parent, StdCompiler::RCT_ID, C4PropListStatic::RefCompileFunc(), C4StringTable::RegString(), s, C4GameScriptHost::ScenPropList, C4GameScriptHost::ScenPrototype, ScriptEngine, StdCompiler::SEP_PART, StdCompiler::Separator(), Set(), Set0(), SetBool(), SetInt(), SetPropList(), SetString(), C4V_Data::Str, Strings, and StdCompiler::Value().
void C4Value::Denumerate | ( | C4ValueNumbers * | numbers | ) |
Definition at line 251 of file C4Value.cpp.
References C4V_Data::Array, C4V_Array, C4V_C4ObjectEnum, C4V_Enum, C4V_PropList, C4PropList::Denumerate(), C4ValueArray::Denumerate(), C4PropListNumbered::GetByNumber(), C4ValueNumbers::GetValue(), C4V_Data::Int, C4PropList::IsNumbered(), C4PropList::IsStatic(), LogF(), C4V_Data::PropList, Set(), Set0(), and SetPropList().
Referenced by C4Player::CompileFunc(), C4Command::Denumerate(), C4PropList::Denumerate(), C4Effect::Denumerate(), and C4GameScriptHost::Denumerate().
|
inline |
Definition at line 118 of file C4Value.h.
References C4V_Data::Array, C4V_Array, and CheckConversion().
Referenced by C4MapScriptAlgoModifier::C4MapScriptAlgoModifier(), C4MapScriptAlgoPolygon::C4MapScriptAlgoPolygon(), C4ValueToMatrix(), C4FindObject::CreateByValue(), C4SortObject::CreateByValue(), C4Object::DrawLine(), C4Object::GetParallaxity(), C4PropList::GetPropertyArray(), C4MapScriptAlgo::GetXYProps(), C4ScriptGuiWindowAction::Init(), C4MapScriptMatTexMask::Init(), C4Object::IsVisible(), C4ParticleValueProvider::Set(), C4ScriptGuiWindowProperty::Set(), C4ParticleProperties::SetCollisionFunc(), and C4AulCompiler::ConstexprEvaluator::visit().
|
inline |
Definition at line 113 of file C4Value.h.
References C4V_Bool, and CheckConversion().
Referenced by AlgoScript(), C4MapScriptAlgoRndChecker::C4MapScriptAlgoRndChecker(), C4FindObjectFunc::Check(), C4FindObjectProperty::Check(), C4Command::Dig(), C4PropList::GetPropertyBool(), C4Object::IsVisible(), and C4AulCompiler::ConstexprEvaluator::visit().
|
inline |
Definition at line 160 of file C4Value.h.
Referenced by ComparisonImpl(), C4ValueNumbers::GetNumberForValue(), IsIdenticalTo(), operator const void *(), and operator!().
StdStrBuf C4Value::GetDataString | ( | int | depth = 10 , |
const class C4PropListStatic * | ignore_reference_parent = nullptr |
||
) | const |
Definition at line 131 of file C4Value.cpp.
References C4V_Bool, C4V_Int, C4V_PropList, FormatString(), C4AulScriptEngine::GetPropList(), GetType(), C4V_Data::Int, C4V_Data::PropList, and ScriptEngine.
Referenced by C4PropList::AppendDataString(), CompileFunc(), C4Object::Draw(), C4Game::GetTranslatedString(), C4AulScriptContext::ReturnDump(), and C4PropertyPath::SetProperty().
C4Def * C4Value::getDef | ( | ) | const |
Definition at line 78 of file C4Value.cpp.
References C4V_Def, CheckConversion(), C4PropList::GetDef(), and C4V_Data::PropList.
Referenced by C4ValueConv< C4ID >::_FromC4V(), C4Command::Acquire(), C4Command::Activate(), C4Command::Fail(), C4Command::Get(), C4Object::GetDragImage(), C4Command::Put(), and C4ScriptGuiWindowProperty::Set().
|
inline |
Definition at line 119 of file C4Value.h.
References C4V_Function, CheckConversion(), and C4V_Data::Fn.
Referenced by CompileFunc(), C4ScriptHost::CopyPropList(), C4EditCursor::DoContextMenu(), C4PropList::EnumerateOwnFuncs(), C4PropList::GetFunc(), and C4ScriptHost::UnlinkOwnedFunctions().
|
inline |
Definition at line 112 of file C4Value.h.
References C4V_Int, CheckConversion(), and C4V_Data::Int.
Referenced by C4Command::Acquire(), C4MapScriptAlgoPolygon::C4MapScriptAlgoPolygon(), C4Effect::CallDamage(), C4Effect::CallEffect(), C4Effect::CallStart(), C4Effect::CallStop(), C4Effect::CallTimer(), C4Effect::Check(), C4SortObjectFunc::CompareGetValue(), C4Object::DrawLine(), C4Command::Enter(), FnParRect(), C4Command::Get(), C4Object::GetParallaxity(), C4PropList::GetPropertyInt(), C4Def::GetValue(), C4Object::GetValue(), C4MapScriptAlgo::GetXYProps(), C4Effect::Init(), C4ScriptGuiWindowAction::Init(), C4GameMessage::Init(), C4Command::InitEvaluation(), C4Object::IsVisible(), C4Command::MoveTo(), C4ParticleValueProvider::Set(), C4ScriptGuiWindowProperty::Set(), C4GUI::FrameDecoration::SetByDef(), C4Object::SetPropertyByS(), C4Effect::SetPropertyByS(), C4FoWLight::Update(), and C4AulCompiler::ConstexprEvaluator::visit().
C4Object * C4Value::getObj | ( | ) | const |
Definition at line 68 of file C4Value.cpp.
References C4V_Object, CheckConversion(), C4PropList::GetObject(), and C4V_Data::PropList.
Referenced by C4FindObjectInArray::Check(), C4EditCursor::Draw(), C4Object::GetDragImage(), C4ScriptGuiWindowAction::Init(), C4EditCursorSelection::ObjectCount(), C4Landscape::P::PostFreeShape(), and C4Object::PutAwayUnusedObject().
|
inline |
Definition at line 116 of file C4Value.h.
References C4V_PropList, CheckConversion(), and C4V_Data::PropList.
Referenced by C4MapScriptAlgoModifier::C4MapScriptAlgoModifier(), C4Effect::ClearPointers(), C4Effect::CompileFunc(), CompileFunc(), C4ScriptGuiWindow::Denumerate(), C4Viewport::Execute(), FnGetEffectsFor(), C4PropList::FreezeAndMakeStaticRecursively(), C4Object::GetAction(), C4Def::GetActionByName(), C4PropList::GetPropertyPropList(), C4ScriptGuiWindowAction::Init(), C4Player::Init(), C4ScriptUniform::Push(), C4PropList::RemoveCyclicPrototypes(), C4ScriptGuiWindowProperty::Set(), C4Object::SetAction(), C4Object::SetActionByName(), C4PropList::SetPropertyByS(), C4PropList::ThawRecursively(), C4GraphicsOverlay::UpdateFacet(), and C4AulCompiler::ConstexprEvaluator::visit().
|
inline |
Definition at line 117 of file C4Value.h.
References C4V_String, CheckConversion(), and C4V_Data::Str.
Referenced by C4FindObjectProcedure::Check(), C4ScriptGuiWindow::CreateFromPropList(), C4EditCursor::DoContextMenu(), C4Object::GetInfoString(), C4PropList::GetPropertyP(), C4PropList::GetPropertyStr(), C4Game::GetTranslatedString(), C4ScriptGuiWindowAction::Init(), C4MapScriptMatTexMask::Init(), C4ValueArraySortStringscomp::operator()(), C4ValueArraySortcomp::operator()(), C4ScriptGuiWindowProperty::Set(), C4Effect::SetPropertyByS(), and C4AulCompiler::ConstexprEvaluator::visit().
|
inline |
Definition at line 161 of file C4Value.h.
Referenced by C4ValueConv< Nillable< T > >::_FromC4V(), ComparisonImpl(), C4Game::CompileFunc(), C4ValueNumbers::CompileValue(), C4ScriptHost::CopyPropList(), GetDataString(), C4Object::GetInfoString(), C4Game::GetTranslatedString(), GetTypeName(), IsIdenticalTo(), C4EditCursor::PerformDuplication(), C4ScriptUniform::Push(), C4Game::SaveData(), C4ValueArray::SetSlice(), ToJSON(), and C4AulCompiler::ConstexprEvaluator::visit().
C4V_Type C4Value::GetTypeEx | ( | ) | const |
Definition at line 623 of file C4Value.cpp.
References C4V_Def, C4V_Effect, C4V_Object, and C4V_PropList.
|
inline |
Definition at line 164 of file C4Value.h.
References GetC4VName(), and GetType().
Referenced by C4AulCompiler::ConstexprEvaluator::visit().
|
inline |
Definition at line 149 of file C4Value.h.
References GetData(), and GetType().
Referenced by C4AulCompiler::ConstexprEvaluator::visit().
|
inlinestaticconstexpr |
|
inline |
|
inline |
bool C4Value::operator!= | ( | const C4Value & | Value2 | ) | const |
Definition at line 618 of file C4Value.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
bool C4Value::operator== | ( | const C4Value & | Value2 | ) | const |
Definition at line 570 of file C4Value.cpp.
References ComparisonImpl(), C4ScriptGuiWindowPropertyName::left, LogF(), C4ScriptGuiWindowPropertyName::right, s, and C4ScriptGuiWindowPropertyName::top.
|
inline |
Definition at line 134 of file C4Value.h.
References Set().
Referenced by CompileFunc(), Denumerate(), operator=(), C4ParticleProperties::Set(), Set(), SetArray(), SetBool(), SetFunction(), SetInt(), SetObjectEnum(), SetPropList(), and SetString().
ALWAYS_INLINE void C4Value::Set0 | ( | ) |
Definition at line 332 of file C4Value.h.
References C4V_Nil.
Referenced by C4Effect::C4Effect(), C4Player::C4Player(), C4PropList::Clear(), C4GameScriptHost::Clear(), C4Effect::ClearPointers(), C4Effect::CompileFunc(), CompileFunc(), C4Command::Default(), Denumerate(), C4GameMessage::Init(), C4ValueArraySortPropertycomp::operator()(), C4SoundModifier::Release(), C4PropList::RemoveCyclicPrototypes(), C4PropList::ResetProperty(), C4Game::SetGlobalSoundModifier(), C4Player::SetSoundModifier(), and C4AulCompiler::ConstexprEvaluator::visit().
|
inline |
Definition at line 139 of file C4Value.h.
References C4V_Data::Array, C4V_Array, and Set().
Referenced by C4ValueNumbers::CompileValue(), and C4AulCompiler::ConstexprEvaluator::visit().
|
inline |
Definition at line 137 of file C4Value.h.
References b, C4V_Bool, C4V_Data::Int, and Set().
Referenced by CompileFunc(), and C4AulCompiler::ConstexprEvaluator::visit().
|
inline |
Definition at line 140 of file C4Value.h.
References C4V_Function, C4V_Data::Fn, and Set().
Referenced by C4AulCompiler::ConstexprEvaluator::visit().
|
inline |
Definition at line 136 of file C4Value.h.
References C4V_Int, C4V_Data::Int, and Set().
Referenced by C4Command::Activate(), CompileFunc(), C4Command::InitEvaluation(), C4Command::Set(), and C4AulCompiler::ConstexprEvaluator::visit().
|
inline |
Definition at line 142 of file C4Value.h.
References C4V_C4ObjectEnum, C4V_Data::Int, and Set().
Referenced by C4Effect::CompileFunc().
|
inline |
Definition at line 141 of file C4Value.h.
References C4V_PropList, C4V_Data::PropList, and Set().
Referenced by C4Effect::C4Effect(), C4SoundModifier::C4SoundModifier(), CompileFunc(), C4ValueNumbers::CompileValue(), Denumerate(), C4GameMessage::Init(), C4Game::InitScriptEngine(), C4GameScriptHost::Load(), C4GameScriptHost::LoadData(), C4Game::SetGlobalSoundModifier(), C4PropList::SetPropertyByS(), and C4Player::SetSoundModifier().
|
inline |
Definition at line 138 of file C4Value.h.
References C4V_String, Set(), and C4V_Data::Str.
Referenced by CompileFunc(), and C4Game::GetTranslatedString().
StdStrBuf C4Value::ToJSON | ( | int | depth = 10 , |
const class C4PropListStatic * | ignore_reference_parent = nullptr |
||
) | const |
Definition at line 189 of file C4Value.cpp.
References StdStrBuf::Append(), StdStrBuf::AppendChar(), C4V_Data::Array, C4V_Array, C4V_Bool, C4V_Function, C4V_Int, C4V_Nil, C4V_PropList, C4V_String, StdStrBuf::EscapeString(), FormatString(), C4String::GetCStr(), StdStrBuf::getData(), C4String::GetData(), C4ValueArray::GetItem(), C4PropListStatic::GetParent(), C4ValueArray::GetSize(), GetType(), C4V_Data::Int, C4PropList::IsStatic(), C4V_Data::PropList, StdStrBuf::Replace(), C4V_Data::Str, C4PropList::ToJSON(), and ToJSON().
Referenced by C4PropList::ToJSON(), and ToJSON().
Definition at line 111 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.
|
friend |