Serialisation – Arma Reforger
(Document top-level JSON struct read and write magic parameter) |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 1: | Line 1: | ||
{{TOC|side}} | {{TOC|side}} | ||
This page | This page explains serialisation using {{Link/Enfusion|armaR|SCR_JsonSaveContext}}/{{Link/Enfusion|armaR|SCR_JsonLoadContext}} and {{Link/Enfusion|armaR|SCR_BinSaveContext}}/{{Link/Enfusion|armaR|SCR_BinLoadContext}}. | ||
== JSON == | == JSON == | ||
{{Feature|informative|Passing an empty string as the name parameter into BaseSerializationSaveContext::WriteValue or BaseSerializationLoadContext::ReadValue allows for a complex top-level struct to be written/read.}} | {{Feature|informative| | ||
* Passing an empty string as the name parameter into BaseSerializationSaveContext::WriteValue or BaseSerializationLoadContext::ReadValue allows for a complex top-level struct to be written/read. | |||
* See also {{Link|Arma Reforger:JsonApiStruct Usage|JsonApiStruct Usage}}. | |||
}} | |||
=== Serialisation === | === Serialisation === |
Revision as of 17:03, 12 January 2023
This page explains serialisation using SCR_JsonSaveContext/SCR_JsonLoadContext and SCR_BinSaveContext/SCR_BinLoadContext.
JSON
Serialisation
Deserialisation
Binary
Serialisation
Deserialisation
Object Serialisation
Simple
The following class set to serialise will serialise all its properties.
NonSerialized
Adding the NonSerialized() decorator to a field will make the serialisation ignore it.
Advanced
The following methods allow to define a custom serialisation per class. This is useful to avoid saving lengthy yet useless information for loading as well as load values in a certain order.
SerializationSave
If an object has the SerializationSave method defined, the SaveContext will use it and not process object's properties automatically at all.
SerializationLoad
If an object has the SerializationLoad method defined, the SaveContext will use it and not process object's properties automatically at all.