Files
SabreTools.Serialization/IFileSerializer.cs
Matt Nadareski 51ccc8ea43 Add interfaces
2023-09-08 16:54:07 -04:00

20 lines
593 B
C#

namespace SabreTools.Serialization
{
/// <summary>
/// Defines how to serialize to and from files
/// </summary>
public interface IFileSerializer<T>
{
/// <summary>
/// Deserialize a file into <typeparamref name="T"/>
/// </summary>
/// <typeparam name="T">Type of object to deserialize to</typeparam>
/// <param name="path">Path to deserialize from</param>
/// <returns>Filled object on success, null on error</returns>
#if NET48
T Deserialize(string path);
#else
T? Deserialize(string? path);
#endif
}
}