MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / LoadFromBytes

Method LoadFromBytes

Source/Engine/Serialization/Stream.cpp:955–974  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

953}
954
955void JsonSerializer::LoadFromBytes(ISerializable* obj, const Span<byte>& data, int32 engineBuild)
956{
957 if (!obj || data.Length() == 0)
958 return;
959
960 ISerializable::SerializeDocument document;
961 {
962 PROFILE_CPU_NAMED("Json.Parse");
963 document.Parse((const char*)data.Get(), data.Length());
964 }
965 if (document.HasParseError())
966 {
967 Log::JsonParseException(document.GetParseError(), document.GetErrorOffset());
968 return;
969 }
970
971 auto modifier = Cache::ISerializeModifier.Get();
972 modifier->EngineBuild = engineBuild;
973 obj->Deserialize(document, modifier.Value);
974}

Callers 4

ReadJsonMethod · 0.80
OnLoadedMethod · 0.80
OnValuesChangedMethod · 0.80
OnScriptsReloadEndMethod · 0.80

Calls 8

JsonParseExceptionClass · 0.85
GetParseErrorMethod · 0.80
LengthMethod · 0.45
ParseMethod · 0.45
GetMethod · 0.45
HasParseErrorMethod · 0.45
GetErrorOffsetMethod · 0.45
DeserializeMethod · 0.45

Tested by

no test coverage detected