2026-03-18 16:13:02 -04:00
|
|
|
namespace SabreTools.Serialization.Writers
|
2024-04-04 02:42:25 -04:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
2025-09-26 15:10:59 -04:00
|
|
|
/// Defines how to write to byte arrays
|
2024-04-04 02:42:25 -04:00
|
|
|
/// </summary>
|
2025-09-26 15:28:53 -04:00
|
|
|
public interface IByteWriter<TModel>
|
2024-04-04 02:42:25 -04:00
|
|
|
{
|
2026-01-25 20:07:59 -05:00
|
|
|
/// <summary>
|
|
|
|
|
/// Enable outputting debug information
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool Debug { get; set; }
|
|
|
|
|
|
2024-04-04 02:42:25 -04:00
|
|
|
/// <summary>
|
2025-09-26 15:28:53 -04:00
|
|
|
/// Serialize a <typeparamref name="TModel"/> into a byte array
|
2024-04-04 02:42:25 -04:00
|
|
|
/// </summary>
|
|
|
|
|
/// <typeparam name="T">Type of object to serialize from</typeparam>
|
|
|
|
|
/// <param name="obj">Data to serialize</param>
|
|
|
|
|
/// <returns>Filled object on success, null on error</returns>
|
2026-01-25 16:15:05 -05:00
|
|
|
public byte[]? SerializeArray(TModel? obj);
|
2024-04-04 02:42:25 -04:00
|
|
|
}
|
2025-07-24 09:31:28 -04:00
|
|
|
}
|