mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-04-10 00:03:49 +00:00
This change looks dramatic, but it's just separating out the already-split namespaces into separate top-level folders. In theory, every single one could be built into their own Nuget package. `SabreTools.Serialization` still builds the normal Nuget package that is used by all other projects and includes all namespaces.
32 lines
1.3 KiB
C#
32 lines
1.3 KiB
C#
namespace SabreTools.Serialization.CrossModel
|
|
{
|
|
/// <summary>
|
|
/// Defines how to convert between two model types
|
|
/// </summary>
|
|
public interface ICrossModel<TSource, TDest>
|
|
{
|
|
/// <summary>
|
|
/// Enable outputting debug information
|
|
/// </summary>
|
|
public bool Debug { get; set; }
|
|
|
|
/// <summary>
|
|
/// Deserialize a <typeparamref name="TDest"/> into <typeparamref name="TSource"/>
|
|
/// </summary>
|
|
/// <typeparam name="T">Type of object to deserialize to</typeparam>
|
|
/// <typeparam name="U">Type of object to deserialize from</typeparam>
|
|
/// <param name="obj">Object to deserialize from</param>
|
|
/// <returns>Filled object on success, null on error</returns>
|
|
public TSource? Deserialize(TDest? obj);
|
|
|
|
/// <summary>
|
|
/// Serialize a <typeparamref name="TSource"/> into <typeparamref name="TDest"/>
|
|
/// </summary>
|
|
/// <typeparam name="T">Type of object to serialize from</typeparam>
|
|
/// <typeparam name="U">Type of object to serialize to</typeparam>
|
|
/// <param name="obj">Object to serialize from</param>
|
|
/// <returns>Filled object on success, null on error</returns>
|
|
public TDest? Serialize(TSource? obj);
|
|
}
|
|
}
|