2024-04-16 18:29:40 +00:00
|
|
|
using YamlDotNet.Serialization;
|
2023-08-12 19:08:38 +01:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|