mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-09-22 14:55:11 +00:00
Make Strings namespace and move Xbox
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
using System;
|
||||
using SabreTools.Serialization.Interfaces;
|
||||
|
||||
namespace SabreTools.Serialization.Files
|
||||
{
|
||||
public partial class XMID : IFileSerializer<Models.Xbox.XMID>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
#if NET48
|
||||
public bool Serialize(Models.Xbox.XMID obj, string path) => throw new NotImplementedException();
|
||||
#else
|
||||
public bool Serialize(Models.Xbox.XMID? obj, string? path) => throw new NotImplementedException();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
using System;
|
||||
using SabreTools.Serialization.Interfaces;
|
||||
|
||||
namespace SabreTools.Serialization.Files
|
||||
{
|
||||
public partial class XeMID : IFileSerializer<Models.Xbox.XeMID>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
#if NET48
|
||||
public bool Serialize(Models.Xbox.XeMID obj, string path) => throw new NotImplementedException();
|
||||
#else
|
||||
public bool Serialize(Models.Xbox.XeMID? obj, string? path) => throw new NotImplementedException();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ namespace SabreTools.Serialization.Interfaces
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Sserialize a <typeparamref name="T"/> into a file
|
||||
/// Serialize a <typeparamref name="T"/> into a file
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Type of object to serialize from</typeparam>
|
||||
/// <param name="obj">Data to serialize</param>
|
||||
|
||||
32
Interfaces/IStringSerializer.cs
Normal file
32
Interfaces/IStringSerializer.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
namespace SabreTools.Serialization.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines how to serialize to and from strings
|
||||
/// </summary>
|
||||
public interface IStringSerializer<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// Deserialize a string into <typeparamref name="T"/>
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Type of object to deserialize to</typeparam>
|
||||
/// <param name="str">String to deserialize from</param>
|
||||
/// <returns>Filled object on success, null on error</returns>
|
||||
#if NET48
|
||||
T Deserialize(string str);
|
||||
#else
|
||||
T? Deserialize(string? str);
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Serialize a <typeparamref name="T"/> into a string
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Type of object to serialize from</typeparam>
|
||||
/// <param name="obj">Data to serialize</param>
|
||||
/// <returns>Filled string on successful serialization, null otherwise</returns>
|
||||
#if NET48
|
||||
string Serialize(T obj);
|
||||
#else
|
||||
string? Serialize(T? obj);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
using SabreTools.Serialization.Interfaces;
|
||||
|
||||
namespace SabreTools.Serialization.Files
|
||||
namespace SabreTools.Serialization.Strings
|
||||
{
|
||||
public partial class XMID : IFileSerializer<Models.Xbox.XMID>
|
||||
public partial class XMID : IStringSerializer<Models.Xbox.XMID>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
/// <remarks>This treats the input path like a parseable string</remarks>
|
||||
#if NET48
|
||||
public Models.Xbox.XMID Deserialize(string path)
|
||||
#else
|
||||
15
Strings/XMID.Serializer.cs
Normal file
15
Strings/XMID.Serializer.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using SabreTools.Serialization.Interfaces;
|
||||
|
||||
namespace SabreTools.Serialization.Strings
|
||||
{
|
||||
public partial class XMID : IStringSerializer<Models.Xbox.XMID>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
#if NET48
|
||||
public string Serialize(Models.Xbox.XMID obj) => throw new NotImplementedException();
|
||||
#else
|
||||
public string? Serialize(Models.Xbox.XMID? obj) => throw new NotImplementedException();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
using SabreTools.Serialization.Interfaces;
|
||||
|
||||
namespace SabreTools.Serialization.Files
|
||||
namespace SabreTools.Serialization.Strings
|
||||
{
|
||||
public partial class XeMID : IFileSerializer<Models.Xbox.XeMID>
|
||||
public partial class XeMID : IStringSerializer<Models.Xbox.XeMID>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
/// <remarks>This treats the input path like a parseable string</remarks>
|
||||
#if NET48
|
||||
public Models.Xbox.XeMID Deserialize(string path)
|
||||
#else
|
||||
15
Strings/XeMID.Serializer.cs
Normal file
15
Strings/XeMID.Serializer.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using SabreTools.Serialization.Interfaces;
|
||||
|
||||
namespace SabreTools.Serialization.Strings
|
||||
{
|
||||
public partial class XeMID : IStringSerializer<Models.Xbox.XeMID>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
#if NET48
|
||||
public string Serialize(Models.Xbox.XeMID obj) => throw new NotImplementedException();
|
||||
#else
|
||||
public string? Serialize(Models.Xbox.XeMID? obj) => throw new NotImplementedException();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user