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

Method ReadJson

Source/Engine/Serialization/Stream.cpp:389–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

387}
388
389void ReadStream::ReadJson(ISerializable* obj)
390{
391 int32 engineBuild, size;
392 ReadInt32(&engineBuild);
393 ReadInt32(&size);
394 if (obj)
395 {
396 if (const auto memoryStream = dynamic_cast<MemoryReadStream*>(this))
397 {
398 JsonSerializer::LoadFromBytes(obj, Span<byte>((byte*)memoryStream->Move(size), size), engineBuild);
399 }
400 else
401 {
402 void* data = Allocator::Allocate(size);
403 ReadBytes(data, size);
404 JsonSerializer::LoadFromBytes(obj, Span<byte>((byte*)data, size), engineBuild);
405 Allocator::Free(data);
406 }
407 }
408 else
409 SetPosition(GetPosition() + size);
410}
411
412void ReadStream::ReadStringAnsi(StringAnsi* data)
413{

Callers

nothing calls this directly

Calls 7

ReadInt32Function · 0.85
LoadFromBytesFunction · 0.85
ReadBytesFunction · 0.85
SetPositionFunction · 0.85
FreeFunction · 0.50
GetPositionFunction · 0.50
MoveMethod · 0.45

Tested by

no test coverage detected