|
|
|
@ -28,6 +28,19 @@ namespace AZ
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
using VariableDescriptor = ExpressionEvaluation::ExpressionTree::VariableDescriptor;
|
|
|
|
using VariableDescriptor = ExpressionEvaluation::ExpressionTree::VariableDescriptor;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static constexpr AZStd::string_view EmptyAnyIdentifier = "Empty AZStd::any";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static bool IsEmptyAny(const rapidjson::Value& typeId)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (typeId.IsString())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
AZStd::string_view typeName(typeId.GetString(), typeId.GetStringLength());
|
|
|
|
|
|
|
|
return typeName == EmptyAnyIdentifier;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
JsonSerializationResult::Result Load
|
|
|
|
JsonSerializationResult::Result Load
|
|
|
|
( void* outputValue
|
|
|
|
( void* outputValue
|
|
|
|
, [[maybe_unused]] const Uuid& outputValueTypeId
|
|
|
|
, [[maybe_unused]] const Uuid& outputValueTypeId
|
|
|
|
@ -62,6 +75,8 @@ namespace AZ
|
|
|
|
, JsonSerialization::TypeIdFieldIdentifier));
|
|
|
|
, JsonSerialization::TypeIdFieldIdentifier));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!IsEmptyAny(typeIdMember->value))
|
|
|
|
|
|
|
|
{
|
|
|
|
result.Combine(LoadTypeId(typeId, typeIdMember->value, context));
|
|
|
|
result.Combine(LoadTypeId(typeId, typeIdMember->value, context));
|
|
|
|
if (typeId.IsNull())
|
|
|
|
if (typeId.IsNull())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -78,6 +93,7 @@ namespace AZ
|
|
|
|
|
|
|
|
|
|
|
|
result.Combine(ContinueLoadingFromJsonObjectField(AZStd::any_cast<void>(&storage), typeId, inputValue, "Value", context));
|
|
|
|
result.Combine(ContinueLoadingFromJsonObjectField(AZStd::any_cast<void>(&storage), typeId, inputValue, "Value", context));
|
|
|
|
outputDatum->m_value = storage;
|
|
|
|
outputDatum->m_value = storage;
|
|
|
|
|
|
|
|
}
|
|
|
|
// any storage end
|
|
|
|
// any storage end
|
|
|
|
|
|
|
|
|
|
|
|
return context.Report(result, result.GetProcessing() != JSR::Processing::Halted
|
|
|
|
return context.Report(result, result.GetProcessing() != JSR::Processing::Halted
|
|
|
|
@ -123,6 +139,8 @@ namespace AZ
|
|
|
|
, azrtti_typeid<decltype(inputScriptDataPtr->m_supportedTypes)>()
|
|
|
|
, azrtti_typeid<decltype(inputScriptDataPtr->m_supportedTypes)>()
|
|
|
|
, context));
|
|
|
|
, context));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!inputScriptDataPtr->m_value.empty())
|
|
|
|
|
|
|
|
{
|
|
|
|
rapidjson::Value typeValue;
|
|
|
|
rapidjson::Value typeValue;
|
|
|
|
result.Combine(StoreTypeId(typeValue, inputScriptDataPtr->m_value.type(), context));
|
|
|
|
result.Combine(StoreTypeId(typeValue, inputScriptDataPtr->m_value.type(), context));
|
|
|
|
outputValue.AddMember
|
|
|
|
outputValue.AddMember
|
|
|
|
@ -137,6 +155,16 @@ namespace AZ
|
|
|
|
, defaultScriptDataPtr ? AZStd::any_cast<void>(const_cast<AZStd::any*>(&defaultScriptDataPtr->m_value)) : nullptr
|
|
|
|
, defaultScriptDataPtr ? AZStd::any_cast<void>(const_cast<AZStd::any*>(&defaultScriptDataPtr->m_value)) : nullptr
|
|
|
|
, inputScriptDataPtr->m_value.type()
|
|
|
|
, inputScriptDataPtr->m_value.type()
|
|
|
|
, context));
|
|
|
|
, context));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
rapidjson::Value emptyAny;
|
|
|
|
|
|
|
|
emptyAny.SetString(EmptyAnyIdentifier.data(), aznumeric_caster(EmptyAnyIdentifier.size()), context.GetJsonAllocator());
|
|
|
|
|
|
|
|
outputValue.AddMember
|
|
|
|
|
|
|
|
( rapidjson::StringRef(JsonSerialization::TypeIdFieldIdentifier)
|
|
|
|
|
|
|
|
, AZStd::move(emptyAny)
|
|
|
|
|
|
|
|
, context.GetJsonAllocator());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return context.Report(result, result.GetProcessing() != JSR::Processing::Halted
|
|
|
|
return context.Report(result, result.GetProcessing() != JSR::Processing::Halted
|
|
|
|
? "VariableDescriptor Store finished saving VariableDescriptor"
|
|
|
|
? "VariableDescriptor Store finished saving VariableDescriptor"
|
|
|
|
|