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

Method Load

Source/Engine/Visject/VisjectMeta.cpp:8–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6#include "Engine/Serialization/WriteStream.h"
7
8bool VisjectMeta::Load(ReadStream* stream, bool loadData)
9{
10 Release();
11
12 int32 entries;
13 stream->ReadInt32(&entries);
14 Entries.Resize(entries);
15
16 for (int32 i = 0; i < entries; i++)
17 {
18 Entry& e = Entries[i];
19
20 stream->ReadInt32(&e.TypeID);
21 DateTime creationTime;
22 stream->Read(creationTime);
23
24 uint32 dataSize;
25 stream->ReadUint32(&dataSize);
26 e.IsLoaded = loadData;
27 if (loadData)
28 {
29 e.Data.Resize(dataSize, false);
30 if (dataSize > 0)
31 {
32 stream->ReadBytes(e.Data.Get(), dataSize);
33 }
34 }
35 else
36 {
37 e.Data.SetCapacity(0);
38 stream->SetPosition(stream->GetPosition() + dataSize);
39 }
40 }
41
42 return false;
43}
44
45bool VisjectMeta::Save(WriteStream* stream, bool saveData) const
46{

Callers

nothing calls this directly

Calls 9

ReleaseFunction · 0.85
ReadInt32Method · 0.45
ResizeMethod · 0.45
ReadMethod · 0.45
ReadBytesMethod · 0.45
GetMethod · 0.45
SetCapacityMethod · 0.45
SetPositionMethod · 0.45
GetPositionMethod · 0.45

Tested by

no test coverage detected