Enfusion Script API
Loading...
Searching...
No Matches
ContainerSerializationLoadContext Interface Reference

Base serialization context for saving data to BaseSerializationSaveContainer based class. More...

Inheritance diagram for ContainerSerializationLoadContext:
BaseSerializationLoadContext BaseSerializationContext ScriptAndConfig Managed

Public Member Functions

void ContainerSerializationLoadContext (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 BaseSerializationLoadContainer GetContainer ()
 Returns the assigned container.
 
proto external void SetContainer (BaseSerializationLoadContainer container)
 Set the new assigned container.
 
- Public Member Functions inherited from BaseSerializationLoadContext
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 BaseSerializationContext
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 ()
 
- Public Member Functions inherited from Managed
proto external ref Managed Clone ()
 Return shallow copy of object, or null if it is not allowed (not public constructor)
 

Detailed Description

Base serialization context for saving data to BaseSerializationSaveContainer based class.

This context passes given data to set container class.

Constructor & Destructor Documentation

◆ ContainerSerializationLoadContext()

void ContainerSerializationLoadContext.ContainerSerializationLoadContext ( 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.

Member Function Documentation

◆ GetContainer()

proto external BaseSerializationLoadContainer ContainerSerializationLoadContext.GetContainer ( )

Returns the assigned container.

◆ SetContainer()

proto external void ContainerSerializationLoadContext.SetContainer ( BaseSerializationLoadContainer container)

Set the new assigned container.

Parameters
containerThe new container.

The documentation for this interface was generated from the following file: