Ser
Library for serializing and deserializing data.
See the Classes
property for information on extending the use
of the Ser library to include other classes.
Properties
Classes
Ser.Classes:
table
A dictionary of classes along with a Serialize and Deserialize function. For instance, the default class added is the Option class, which looks like the following:
Ser.Classes.Option = {
Serialize = function(opt) return opt:Serialize() end;
Deserialize = Option.Deserialize;
}
Add to this table in order to extend what classes are automatically serialized/deserialized.
The Ser library checks every object's ClassName
field in both serialized
and deserialized data in order to map it to the correct function within
the Classes table.
Functions
SerializeArgs
Ser.
SerializeArgs
(
...:
any
) →
args:
table
Serializes the arguments and returns the serialized values in a table.
SerializeArgsAndUnpack
Ser.
SerializeArgsAndUnpack
(
...:
any
) →
args:
...any
Serializes the arguments and returns the serialized values.
DeserializeArgs
Ser.
DeserializeArgs
(
...:
any
) →
args:
table
Deserializes the arguments and returns the deserialized values in a table.
DeserializeArgsAndUnpack
Ser.
DeserializeArgsAndUnpack
(
...:
any
) →
args:
table
Deserializes the arguments and returns the deserialized values.
Serialize
Ser.
Serialize
(
value:
any
) →
any
Serializes the given value.
Deserialize
Ser.
Deserialize
(
value:
any
) →
any
Deserializes the given value.
UnpackArgs
Ser.
UnpackArgs
(
value:
any
) →
any
Unpacks the arguments returned by either SerializeArgs
or DeserializeArgs
.