![]() |
|
Base serialization context for saving data to SaveContainer based class. More...
Public Member Functions | |
| void | LoadContainerContext (bool skipEmptyObjects=true) |
| skipEmptyObjects : This feature is for loading data where only objects with some data are present and empty objects are skipped. | |
| proto external LoadContainer | GetContainer () |
| Returns the assigned container. | |
| proto external void | SetContainer (LoadContainer container) |
| Set the new assigned container. | |
Public Member Functions inherited from LoadContext | |
| proto bool | Read (out void value) |
| Read a given value. Name of property is automatically derived from the input variable name. | |
| proto bool | ReadValue (string name, out void value) |
| Read an explictly named value. | |
| proto bool | ReadDefault (out void value, void defaultValue) |
| s. Read, if the property was not found but the context type allows to seek members (e.g. json) it will return the default value provided. | |
| proto bool | ReadValueDefault (string name, out void value, void defaultValue) |
| s. ReadValue andReadDefault | |
| proto bool | ReadMapKey (int idx, out string key) |
| Manual map key reading, must be read in order (idx=0..N) | |
| proto external bool | DoesKeyExist (string name) |
| Check if the currently open object has any member with the given key name. | |
| proto external bool | DoesObjectExist (string name) |
| Check if the context has a child object of that name. | |
Public Member Functions inherited from SerializationContext | |
| proto external bool | CanSeekMembers () |
| proto external bool | IsValid () |
| proto external string | GetDataExtension () |
| proto external void | ConfigureTypeDiscriminator (string fieldName="$type") |
| Type discriminator is used to add polymorph object instance support to the serializer. | |
| proto external bool | EnableTypeDiscriminator (bool enabled) |
| Enable or disable, can be used to pause it for a specific variable and resume after it was written. | |
| proto external bool | IsTypeDiscriminatorEnabled () |
| Is the type discrimiation currently enabled. | |
| proto external void | Reset () |
| Reset buffers to re-use for new data. | |
| proto bool | StartMap (string name, out int count) |
| Start new map. Empty name will result in an anonymous map. Count must be known ahead of time. | |
| proto external bool | EndMap () |
| proto bool | StartArray (string name, out int count) |
| Start new array. Empty name will result in an anonymous array. Count must be known ahead of time. | |
| proto external bool | EndArray () |
| proto external bool | StartObject (string name=string.Empty) |
| Start new subobject. Empty name will result in an anonymous object. | |
| proto external bool | EndObject () |
Base serialization context for saving data to SaveContainer based class.
This context passes given data to set container class.
| void LoadContainerContext.LoadContainerContext | ( | bool | skipEmptyObjects = true | ) |
skipEmptyObjects : This feature is for loading data where only objects with some data are present and empty objects are skipped.
If this feature is enabled, the context won't fail on StartObject method if it's not present in the data. Only when caller attempts to read key from this missing object it ends with error.
| proto external LoadContainer LoadContainerContext.GetContainer | ( | ) |
Returns the assigned container.
| proto external void LoadContainerContext.SetContainer | ( | LoadContainer | container | ) |
Set the new assigned container.
| container | The new container. |