Table of Contents

Interface IDataSerializer

Namespace
Playnite.SDK.Data
Assembly
Playnite.SDK.dll

Describes data serializer.

public interface IDataSerializer

Methods

AreObjectsEqual(object, object)

Compares two objects using json serialization.

bool AreObjectsEqual(object object1, object object2)

Parameters

object1 object
object2 object

Returns

bool

FromJsonFile<T>(string)

Deserialize an object from a file containing JSON string.

T FromJsonFile<T>(string filePath) where T : class

Parameters

filePath string

Returns

T

Type Parameters

T

FromJsonStream<T>(Stream)

Deserialize an object from JSON data stream.

T FromJsonStream<T>(Stream stream) where T : class

Parameters

stream Stream

Returns

T

Type Parameters

T

FromJson<T>(string)

Deserialize an object from JSON string.

T FromJson<T>(string json) where T : class

Parameters

json string

Returns

T

Type Parameters

T

FromTomlFile<T>(string)

Deserialize an object from a file containing TOML string.

T FromTomlFile<T>(string filePath) where T : class

Parameters

filePath string

Returns

T

Type Parameters

T

FromToml<T>(string)

Deserialize an object from TOML string.

T FromToml<T>(string toml) where T : class

Parameters

toml string

Returns

T

Type Parameters

T

FromYamlFile<T>(string)

Deserialize an object from a file containing YAML string.

T FromYamlFile<T>(string filePath) where T : class

Parameters

filePath string

Returns

T

Type Parameters

T

FromYaml<T>(string)

Deserialize an object from YAML string.

T FromYaml<T>(string yaml) where T : class

Parameters

yaml string

Returns

T

Type Parameters

T

GetClone<T>(T)

Creates clone of an object using json serialization.

T GetClone<T>(T source) where T : class

Parameters

source T

Returns

T

Type Parameters

T

GetClone<T, U>(T)

Creates clone of an object using json serialization.

U GetClone<T, U>(T source) where T : class where U : class

Parameters

source T

Returns

U

Type Parameters

T
U

ToJson(object, bool)

Serialize an object to JSON string.

string ToJson(object obj, bool formatted = false)

Parameters

obj object
formatted bool

Returns

string

ToJsonStream(object, Stream, bool)

Serialize an object to JSON string written to a stream.

void ToJsonStream(object obj, Stream stream, bool formatted = false)

Parameters

obj object
stream Stream
formatted bool

ToYaml(object)

Serialize an object to YAML string.

string ToYaml(object obj)

Parameters

obj object

Returns

string

TryFromJsonFile<T>(string, out T)

Tries to deserialize an object from JSON file.

bool TryFromJsonFile<T>(string filePath, out T content) where T : class

Parameters

filePath string
content T

Returns

bool

Type Parameters

T

TryFromJsonFile<T>(string, out T, out Exception)

Tries to deserialize an object from JSON file.

bool TryFromJsonFile<T>(string filePath, out T content, out Exception error) where T : class

Parameters

filePath string
content T
error Exception

Returns

bool

Type Parameters

T

TryFromJsonStream<T>(Stream, out T)

Tries to deserialize an object from JSON data stream.

bool TryFromJsonStream<T>(Stream stream, out T content) where T : class

Parameters

stream Stream
content T

Returns

bool

Type Parameters

T

TryFromJsonStream<T>(Stream, out T, out Exception)

Tries to deserialize an object from JSON data stream.

bool TryFromJsonStream<T>(Stream stream, out T content, out Exception error) where T : class

Parameters

stream Stream
content T
error Exception

Returns

bool

Type Parameters

T

TryFromJson<T>(string, out T)

Tries to deserialize an object from JSON string.

bool TryFromJson<T>(string json, out T content) where T : class

Parameters

json string
content T

Returns

bool

Type Parameters

T

TryFromJson<T>(string, out T, out Exception)

Tries to deserialize an object from JSON string.

bool TryFromJson<T>(string json, out T content, out Exception error) where T : class

Parameters

json string
content T
error Exception

Returns

bool

Type Parameters

T

TryFromTomlFile<T>(string, out T)

Tries to deserialize an object from TOML file.

bool TryFromTomlFile<T>(string filePath, out T content) where T : class

Parameters

filePath string
content T

Returns

bool

Type Parameters

T

TryFromTomlFile<T>(string, out T, out Exception)

Tries to deserialize an object from TOML file.

bool TryFromTomlFile<T>(string filePath, out T content, out Exception error) where T : class

Parameters

filePath string
content T
error Exception

Returns

bool

Type Parameters

T

TryFromToml<T>(string, out T)

Tries to deserialize an object from TOML string.

bool TryFromToml<T>(string toml, out T content) where T : class

Parameters

toml string
content T

Returns

bool

Type Parameters

T

TryFromToml<T>(string, out T, out Exception)

Tries to deserialize an object from TOML string.

bool TryFromToml<T>(string toml, out T content, out Exception error) where T : class

Parameters

toml string
content T
error Exception

Returns

bool

Type Parameters

T

TryFromYamlFile<T>(string, out T)

Tries to serialize an object to YAML file.

bool TryFromYamlFile<T>(string filePath, out T content) where T : class

Parameters

filePath string
content T

Returns

bool

Type Parameters

T

TryFromYamlFile<T>(string, out T, out Exception)

Tries to serialize an object to YAML file.

bool TryFromYamlFile<T>(string filePath, out T content, out Exception error) where T : class

Parameters

filePath string
content T
error Exception

Returns

bool

Type Parameters

T

TryFromYaml<T>(string, out T)

Tries to deserialize an object from YAML string.

bool TryFromYaml<T>(string yaml, out T content) where T : class

Parameters

yaml string
content T

Returns

bool

Type Parameters

T

TryFromYaml<T>(string, out T, out Exception)

Tries to deserialize an object from YAML string.

bool TryFromYaml<T>(string yaml, out T content, out Exception error) where T : class

Parameters

yaml string
content T
error Exception

Returns

bool

Type Parameters

T