MCPcopy Create free account
hub / github.com/ZDoom/Raze / RecurseWriteFields

Function RecurseWriteFields

source/common/objects/dobjtype.cpp:94–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92//==========================================================================
93
94static void RecurseWriteFields(const PClass *type, FSerializer &ar, const void *addr)
95{
96 if (type != nullptr)
97 {
98 RecurseWriteFields(type->ParentClass, ar, addr);
99 // Don't write this part if it has no non-transient variables
100 for (unsigned i = 0; i < type->Fields.Size(); ++i)
101 {
102 if (!(type->Fields[i]->Flags & (VARF_Transient|VARF_Meta)))
103 {
104 // Tag this section with the class it came from in case
105 // a more-derived class has variables that shadow a less-
106 // derived class. Whether or not that is a language feature
107 // that will actually be allowed remains to be seen.
108 FString key;
109 key.Format("class:%s", type->TypeName.GetChars());
110 if (ar.BeginObject(key.GetChars()))
111 {
112 type->VMType->Symbols.WriteFields(ar, addr);
113 ar.EndObject();
114 }
115 break;
116 }
117 }
118 }
119}
120
121// Same as WriteValue, but does not create a new object in the serializer
122// This is so that user variables do not contain unnecessary subblocks.

Callers 1

WriteAllFieldsMethod · 0.85

Calls 6

WriteFieldsMethod · 0.80
SizeMethod · 0.45
FormatMethod · 0.45
GetCharsMethod · 0.45
BeginObjectMethod · 0.45
EndObjectMethod · 0.45

Tested by

no test coverage detected