chomp
6e4c7abf73
Co-authored-by: Alex <alex@dm-me-for-questions.com> Reviewed-on: SPT-AKI/LootDumpProcessor#6
19 lines
557 B
C#
19 lines
557 B
C#
using YamlDotNet.Serialization;
|
|
|
|
namespace LootDumpProcessor.Serializers.Yaml;
|
|
|
|
public class YamlDotNetYamlSerializer : IYamlSerializer
|
|
{
|
|
private static readonly IDeserializer yamlDeserializer = new DeserializerBuilder().Build();
|
|
private static readonly YamlDotNet.Serialization.ISerializer yamlSerializer = new SerializerBuilder().Build();
|
|
|
|
public string Serialize<T>(T obj)
|
|
{
|
|
return yamlSerializer.Serialize(obj);
|
|
}
|
|
|
|
public T Deserialize<T>(string obj)
|
|
{
|
|
return yamlDeserializer.Deserialize<T>(obj);
|
|
}
|
|
} |