| 92 | //========================================================================== |
| 93 | |
| 94 | static 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. |
no test coverage detected