Class SerializerYaml
YAML serializer.
Implements
Namespace: Evergine.Common.Serialization
Assembly: Evergine.Common.dll
Syntax
public class SerializerYaml : ISerializer
Methods
CleanCache()
Cleans the cache of serializer types.
Declaration
public static void CleanCache()
Deserialize(Stream)
Deserializes the specified stream.
Declaration
public object Deserialize(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream. |
Returns
Type | Description |
---|---|
object | The deserialized object. |
Deserialize(Stream, Type)
Deserializes the specified stream.
Declaration
public object Deserialize(Stream stream, Type type)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The input stream. |
Type | type | The expected type. |
Returns
Type | Description |
---|---|
object | The deserialized object. |
DeserializeInto<T>(Stream, T)
Deserializes the specified stream.
Declaration
public T DeserializeInto<T>(Stream stream, T existingObject)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream. |
T | existingObject | The object to deserialize into. If null (the default), a new object will be created. |
Returns
Type | Description |
---|---|
T | Deserialized object. |
Type Parameters
Name | Description |
---|---|
T | The type to be deserialized. |
GetSerializer(Type)
Gets a new serializer instance.
Declaration
public static SerializerYaml GetSerializer(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The serializer type. |
Returns
Type | Description |
---|---|
SerializerYaml | An ISerializer instance. |
GetSerializer<T>()
Gets a new serializer instance.
Declaration
public static ISerializer GetSerializer<T>()
Returns
Type | Description |
---|---|
ISerializer | An ISerializer instance. |
Type Parameters
Name | Description |
---|---|
T | Generic type. |
Serialize(Stream, object)
Serializes the specified object into the stream.
Declaration
public void Serialize(Stream stream, object obj)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream. |
object | obj | The object. |
Serialize(Stream, object, Type)
Serializes the specified object into the stream using the specified type.
Declaration
public void Serialize(Stream stream, object obj, Type type)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream. |
object | obj | The object. |
Type | type | The object type. |