mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-02-12 21:32:44 +00:00
25 lines
768 B
C#
25 lines
768 B
C#
namespace SabreTools.Serialization.Files
|
|
{
|
|
public partial class Hashfile : IFileSerializer<Models.Hashfile.Hashfile>
|
|
{
|
|
/// <inheritdoc/>
|
|
#if NET48
|
|
public Models.Hashfile.Hashfile Deserialize(string path) => Deserialize(path, Hash.CRC);
|
|
#else
|
|
public Models.Hashfile.Hashfile? Deserialize(string? path) => Deserialize(path, Hash.CRC);
|
|
#endif
|
|
|
|
/// <inheritdoc/>
|
|
#if NET48
|
|
public Models.Hashfile.Hashfile Deserialize(string path, Hash hash)
|
|
#else
|
|
public Models.Hashfile.Hashfile? Deserialize(string? path, Hash hash)
|
|
#endif
|
|
{
|
|
using (var stream = PathProcessor.OpenStream(path))
|
|
{
|
|
return new Streams.Hashfile().Deserialize(stream, hash);
|
|
}
|
|
}
|
|
}
|
|
} |