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

Utility context used for temporarily buffering serialization data to apply sequentially later. More...

Inheritance diagram for BufferSerializationSaveContext:
BaseSerializationSaveContext BaseSerializationContext ScriptAndConfig Managed

Public Member Functions

proto external void Configure (BaseSerializationSaveContext other)
 Configure the bufffer with the same characteristics as another "main" context. Primarily relevant for the ability to seek members.
 
proto external void Apply (BaseSerializationSaveContext other)
 Apply all buffered instructions on the target save context.
 
proto external int GetInstructionCount ()
 Get amount of instructions buffered.
 
- Public Member Functions inherited from BaseSerializationSaveContext
proto bool Write (void value)
 Write the value under the name of the variable passed.
 
proto bool WriteValue (string name, void value)
 Write the value under the specified name.
 
proto bool WriteDefault (void value, void defaultValue)
 Write the value only it does not match the provided default value, or the context does not allow seeking (e.g. json=no default, binary=defaults written)
 
proto bool WriteValueDefault (string name, void value, void defaultValue)
 s. WriteValue and WriteDefault
 
proto external bool WriteMapKey (string key)
 Set the next map key for manual map writing (StartMap).
 
- 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)
 

Static Public Member Functions

static BufferSerializationSaveContext Create (notnull BaseSerializationSaveContext other)
 Utility to create a preconfigured buffer context.
 

Detailed Description

Utility context used for temporarily buffering serialization data to apply sequentially later.

Member Function Documentation

◆ Apply()

proto external void BufferSerializationSaveContext.Apply ( BaseSerializationSaveContext other)

Apply all buffered instructions on the target save context.

◆ Configure()

proto external void BufferSerializationSaveContext.Configure ( BaseSerializationSaveContext other)

Configure the bufffer with the same characteristics as another "main" context. Primarily relevant for the ability to seek members.

◆ Create()

static BufferSerializationSaveContext BufferSerializationSaveContext.Create ( notnull BaseSerializationSaveContext other)
static

Utility to create a preconfigured buffer context.

◆ GetInstructionCount()

proto external int BufferSerializationSaveContext.GetInstructionCount ( )

Get amount of instructions buffered.


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