mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-04-27 16:49:56 +00:00
23 lines
631 B
C#
23 lines
631 B
C#
using System.IO;
|
|
using SabreTools.Serialization.Interfaces;
|
|
|
|
namespace SabreTools.Serialization.Files
|
|
{
|
|
public partial class CueSheet : IFileSerializer<Models.CueSheets.CueSheet>
|
|
{
|
|
/// <inheritdoc/>
|
|
public bool Serialize(Models.CueSheets.CueSheet? obj, string? path)
|
|
{
|
|
if (string.IsNullOrEmpty(path))
|
|
return false;
|
|
|
|
using var stream = new Streams.CueSheet().Serialize(obj);
|
|
if (stream == null)
|
|
return false;
|
|
|
|
using var fs = File.OpenWrite(path);
|
|
stream.CopyTo(fs);
|
|
return true;
|
|
}
|
|
}
|
|
} |