mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-02-04 05:36:12 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc5374108c | ||
|
|
15452ded52 | ||
|
|
49c6c4412b | ||
|
|
cfc53f66a8 | ||
|
|
ec1fb7247c | ||
|
|
54b1eef8ae | ||
|
|
f448314309 | ||
|
|
c4e8debb15 | ||
|
|
822839c813 | ||
|
|
27d36a11ca | ||
|
|
92d9ca932d |
4
.github/workflows/build_nupkg.yml
vendored
4
.github/workflows/build_nupkg.yml
vendored
@@ -28,13 +28,13 @@ jobs:
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: 'Nuget Package'
|
||||
path: 'bin/Release/*.nupkg'
|
||||
path: 'SabreTools.Serialization/bin/Release/*.nupkg'
|
||||
|
||||
- name: Upload to rolling
|
||||
uses: ncipollo/release-action@v1.14.0
|
||||
with:
|
||||
allowUpdates: True
|
||||
artifacts: 'bin/Release/*.nupkg'
|
||||
artifacts: 'SabreTools.Serialization/bin/Release/*.nupkg'
|
||||
body: 'Last built commit: ${{ github.sha }}'
|
||||
name: 'Rolling Release'
|
||||
prerelease: True
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
using SabreTools.Models.PIC;
|
||||
using SabreTools.Serialization.Interfaces;
|
||||
|
||||
namespace SabreTools.Serialization.Files
|
||||
{
|
||||
public partial class PIC : IFileSerializer<DiscInformation>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public DiscInformation? Deserialize(string? path)
|
||||
{
|
||||
using (var stream = PathProcessor.OpenStream(path))
|
||||
{
|
||||
return new Streams.PIC().Deserialize(stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.0.31903.59
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SabreTools.Serialization", "SabreTools.Serialization.csproj", "{5B688801-5F36-483E-B2E8-F219BA5923A2}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SabreTools.Serialization", "SabreTools.Serialization\SabreTools.Serialization.csproj", "{5B688801-5F36-483E-B2E8-F219BA5923A2}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "Test\Test.csproj", "{F3DEE31A-4726-464C-A90C-C19D78F51898}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -18,5 +20,9 @@ Global
|
||||
{5B688801-5F36-483E-B2E8-F219BA5923A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5B688801-5F36-483E-B2E8-F219BA5923A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5B688801-5F36-483E-B2E8-F219BA5923A2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F3DEE31A-4726-464C-A90C-C19D78F51898}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F3DEE31A-4726-464C-A90C-C19D78F51898}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F3DEE31A-4726-464C-A90C-C19D78F51898}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F3DEE31A-4726-464C-A90C-C19D78F51898}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
@@ -561,6 +561,10 @@ namespace SabreTools.Serialization
|
||||
}
|
||||
|
||||
dialogItemExtendedTemplates.Add(dialogItemTemplate);
|
||||
|
||||
// If we have an invalid item count
|
||||
if (offset >= entry.Data.Length)
|
||||
break;
|
||||
}
|
||||
|
||||
dialogBoxResource.ExtendedDialogItemTemplates = [.. dialogItemExtendedTemplates];
|
||||
@@ -805,6 +809,10 @@ namespace SabreTools.Serialization
|
||||
}
|
||||
|
||||
dialogItemTemplates.Add(dialogItemTemplate);
|
||||
|
||||
// If we have an invalid item count
|
||||
if (offset >= entry.Data.Length)
|
||||
break;
|
||||
}
|
||||
|
||||
dialogBoxResource.DialogItemTemplates = [.. dialogItemTemplates];
|
||||
14
SabreTools.Serialization/Files/AACS.Deserializer.cs
Normal file
14
SabreTools.Serialization/Files/AACS.Deserializer.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using SabreTools.Serialization.Interfaces;
|
||||
|
||||
namespace SabreTools.Serialization.Files
|
||||
{
|
||||
public partial class AACS : IFileSerializer<Models.AACS.MediaKeyBlock>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public Models.AACS.MediaKeyBlock? Deserialize(string? path)
|
||||
{
|
||||
using var stream = PathProcessor.OpenStream(path);
|
||||
return new Streams.AACS().Deserialize(stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
SabreTools.Serialization/Files/AACS.Serializer.cs
Normal file
22
SabreTools.Serialization/Files/AACS.Serializer.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using SabreTools.Serialization.Interfaces;
|
||||
|
||||
namespace SabreTools.Serialization.Files
|
||||
{
|
||||
public partial class AACS : IFileSerializer<Models.AACS.MediaKeyBlock>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Serialize(Models.AACS.MediaKeyBlock? obj, string? path)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
return false;
|
||||
|
||||
using var stream = new Streams.AACS().Serialize(obj);
|
||||
if (stream == null)
|
||||
return false;
|
||||
|
||||
using var fs = System.IO.File.OpenWrite(path);
|
||||
stream.CopyTo(fs);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,10 +8,8 @@ namespace SabreTools.Serialization.Files
|
||||
/// <inheritdoc/>
|
||||
public MetadataFile? Deserialize(string? path)
|
||||
{
|
||||
using (var stream = PathProcessor.OpenStream(path))
|
||||
{
|
||||
return new Streams.AttractMode().Deserialize(stream);
|
||||
}
|
||||
using var stream = PathProcessor.OpenStream(path);
|
||||
return new Streams.AttractMode().Deserialize(stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
14
SabreTools.Serialization/Files/BDPlus.Deserializer.cs
Normal file
14
SabreTools.Serialization/Files/BDPlus.Deserializer.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using SabreTools.Serialization.Interfaces;
|
||||
|
||||
namespace SabreTools.Serialization.Files
|
||||
{
|
||||
public partial class BDPlus : IFileSerializer<Models.BDPlus.SVM>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public Models.BDPlus.SVM? Deserialize(string? path)
|
||||
{
|
||||
using var stream = PathProcessor.OpenStream(path);
|
||||
return new Streams.BDPlus().Deserialize(stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
SabreTools.Serialization/Files/BDPlus.Serializer.cs
Normal file
22
SabreTools.Serialization/Files/BDPlus.Serializer.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using SabreTools.Serialization.Interfaces;
|
||||
|
||||
namespace SabreTools.Serialization.Files
|
||||
{
|
||||
public partial class BDPlus : IFileSerializer<Models.BDPlus.SVM>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Serialize(Models.BDPlus.SVM? obj, string? path)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
return false;
|
||||
|
||||
using var stream = new Streams.BDPlus().Serialize(obj);
|
||||
if (stream == null)
|
||||
return false;
|
||||
|
||||
using var fs = System.IO.File.OpenWrite(path);
|
||||
stream.CopyTo(fs);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
14
SabreTools.Serialization/Files/BFPK.Deserializer.cs
Normal file
14
SabreTools.Serialization/Files/BFPK.Deserializer.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using SabreTools.Serialization.Interfaces;
|
||||
|
||||
namespace SabreTools.Serialization.Files
|
||||
{
|
||||
public partial class BFPK : IFileSerializer<Models.BFPK.Archive>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public Models.BFPK.Archive? Deserialize(string? path)
|
||||
{
|
||||
using var stream = PathProcessor.OpenStream(path);
|
||||
return new Streams.BFPK().Deserialize(stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
SabreTools.Serialization/Files/BFPK.Serializer.cs
Normal file
22
SabreTools.Serialization/Files/BFPK.Serializer.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using SabreTools.Serialization.Interfaces;
|
||||
|
||||
namespace SabreTools.Serialization.Files
|
||||
{
|
||||
public partial class BFPK : IFileSerializer<Models.BFPK.Archive>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Serialize(Models.BFPK.Archive? obj, string? path)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
return false;
|
||||
|
||||
using var stream = new Streams.BFPK().Serialize(obj);
|
||||
if (stream == null)
|
||||
return false;
|
||||
|
||||
using var fs = System.IO.File.OpenWrite(path);
|
||||
stream.CopyTo(fs);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
14
SabreTools.Serialization/Files/BSP.Deserializer.cs
Normal file
14
SabreTools.Serialization/Files/BSP.Deserializer.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using SabreTools.Serialization.Interfaces;
|
||||
|
||||
namespace SabreTools.Serialization.Files
|
||||
{
|
||||
public partial class BSP : IFileSerializer<Models.BSP.File>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public Models.BSP.File? Deserialize(string? path)
|
||||
{
|
||||
using var stream = PathProcessor.OpenStream(path);
|
||||
return new Streams.BSP().Deserialize(stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
SabreTools.Serialization/Files/BSP.Serializer.cs
Normal file
22
SabreTools.Serialization/Files/BSP.Serializer.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using SabreTools.Serialization.Interfaces;
|
||||
|
||||
namespace SabreTools.Serialization.Files
|
||||
{
|
||||
public partial class BSP : IFileSerializer<Models.BSP.File>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Serialize(Models.BSP.File? obj, string? path)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
return false;
|
||||
|
||||
using var stream = new Streams.BSP().Serialize(obj);
|
||||
if (stream == null)
|
||||
return false;
|
||||
|
||||
using var fs = System.IO.File.OpenWrite(path);
|
||||
stream.CopyTo(fs);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
14
SabreTools.Serialization/Files/CFB.Deserializer.cs
Normal file
14
SabreTools.Serialization/Files/CFB.Deserializer.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using SabreTools.Serialization.Interfaces;
|
||||
|
||||
namespace SabreTools.Serialization.Files
|
||||
{
|
||||
public partial class CFB : IFileSerializer<Models.CFB.Binary>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public Models.CFB.Binary? Deserialize(string? path)
|
||||
{
|
||||
using var stream = PathProcessor.OpenStream(path);
|
||||
return new Streams.CFB().Deserialize(stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
SabreTools.Serialization/Files/CFB.Serializer.cs
Normal file
22
SabreTools.Serialization/Files/CFB.Serializer.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using SabreTools.Serialization.Interfaces;
|
||||
|
||||
namespace SabreTools.Serialization.Files
|
||||
{
|
||||
public partial class CFB : IFileSerializer<Models.CFB.Binary>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Serialize(Models.CFB.Binary? obj, string? path)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
return false;
|
||||
|
||||
using var stream = new Streams.CFB().Serialize(obj);
|
||||
if (stream == null)
|
||||
return false;
|
||||
|
||||
using var fs = System.IO.File.OpenWrite(path);
|
||||
stream.CopyTo(fs);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
14
SabreTools.Serialization/Files/CIA.Deserializer.cs
Normal file
14
SabreTools.Serialization/Files/CIA.Deserializer.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using SabreTools.Serialization.Interfaces;
|
||||
|
||||
namespace SabreTools.Serialization.Files
|
||||
{
|
||||
public partial class CIA : IFileSerializer<Models.N3DS.CIA>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public Models.N3DS.CIA? Deserialize(string? path)
|
||||
{
|
||||
using var stream = PathProcessor.OpenStream(path);
|
||||
return new Streams.CIA().Deserialize(stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
SabreTools.Serialization/Files/CIA.Serializer.cs
Normal file
22
SabreTools.Serialization/Files/CIA.Serializer.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using SabreTools.Serialization.Interfaces;
|
||||
|
||||
namespace SabreTools.Serialization.Files
|
||||
{
|
||||
public partial class CIA : IFileSerializer<Models.N3DS.CIA>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Serialize(Models.N3DS.CIA? obj, string? path)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
return false;
|
||||
|
||||
using var stream = new Streams.CIA().Serialize(obj);
|
||||
if (stream == null)
|
||||
return false;
|
||||
|
||||
using var fs = System.IO.File.OpenWrite(path);
|
||||
stream.CopyTo(fs);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,10 +11,8 @@ namespace SabreTools.Serialization.Files
|
||||
/// <inheritdoc/>
|
||||
public MetadataFile? Deserialize(string? path, bool quotes)
|
||||
{
|
||||
using (var stream = PathProcessor.OpenStream(path))
|
||||
{
|
||||
return new Streams.ClrMamePro().Deserialize(stream, quotes);
|
||||
}
|
||||
using var stream = PathProcessor.OpenStream(path);
|
||||
return new Streams.ClrMamePro().Deserialize(stream, quotes);
|
||||
}
|
||||
}
|
||||
}
|
||||
14
SabreTools.Serialization/Files/CueSheet.Deserializer.cs
Normal file
14
SabreTools.Serialization/Files/CueSheet.Deserializer.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using SabreTools.Serialization.Interfaces;
|
||||
|
||||
namespace SabreTools.Serialization.Files
|
||||
{
|
||||
public partial class CueSheet : IFileSerializer<Models.CueSheets.CueSheet>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public Models.CueSheets.CueSheet? Deserialize(string? path)
|
||||
{
|
||||
using var stream = PathProcessor.OpenStream(path);
|
||||
return new Streams.CueSheet().Deserialize(stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,10 +8,8 @@ namespace SabreTools.Serialization.Files
|
||||
/// <inheritdoc/>
|
||||
public MetadataFile? Deserialize(string? path)
|
||||
{
|
||||
using (var stream = PathProcessor.OpenStream(path))
|
||||
{
|
||||
return new Streams.DosCenter().Deserialize(stream);
|
||||
}
|
||||
using var stream = PathProcessor.OpenStream(path);
|
||||
return new Streams.DosCenter().Deserialize(stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,10 +8,8 @@ namespace SabreTools.Serialization.Files
|
||||
/// <inheritdoc/>
|
||||
public MetadataFile? Deserialize(string? path)
|
||||
{
|
||||
using (var stream = PathProcessor.OpenStream(path))
|
||||
{
|
||||
return new Streams.EverdriveSMDB().Deserialize(stream);
|
||||
}
|
||||
using var stream = PathProcessor.OpenStream(path);
|
||||
return new Streams.EverdriveSMDB().Deserialize(stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
14
SabreTools.Serialization/Files/GCF.Deserializer.cs
Normal file
14
SabreTools.Serialization/Files/GCF.Deserializer.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using SabreTools.Serialization.Interfaces;
|
||||
|
||||
namespace SabreTools.Serialization.Files
|
||||
{
|
||||
public partial class GCF : IFileSerializer<Models.GCF.File>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public Models.GCF.File? Deserialize(string? path)
|
||||
{
|
||||
using var stream = PathProcessor.OpenStream(path);
|
||||
return new Streams.GCF().Deserialize(stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
SabreTools.Serialization/Files/GCF.Serializer.cs
Normal file
22
SabreTools.Serialization/Files/GCF.Serializer.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using SabreTools.Serialization.Interfaces;
|
||||
|
||||
namespace SabreTools.Serialization.Files
|
||||
{
|
||||
public partial class GCF : IFileSerializer<Models.GCF.File>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Serialize(Models.GCF.File? obj, string? path)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
return false;
|
||||
|
||||
using var stream = new Streams.GCF().Serialize(obj);
|
||||
if (stream == null)
|
||||
return false;
|
||||
|
||||
using var fs = System.IO.File.OpenWrite(path);
|
||||
stream.CopyTo(fs);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,10 +10,8 @@ namespace SabreTools.Serialization.Files
|
||||
/// <inheritdoc/>
|
||||
public Models.Hashfile.Hashfile? Deserialize(string? path, Hash hash)
|
||||
{
|
||||
using (var stream = PathProcessor.OpenStream(path))
|
||||
{
|
||||
return new Streams.Hashfile().Deserialize(stream, hash);
|
||||
}
|
||||
using var stream = PathProcessor.OpenStream(path);
|
||||
return new Streams.Hashfile().Deserialize(stream, hash);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,10 +7,8 @@ namespace SabreTools.Serialization.Files
|
||||
/// <inheritdoc/>
|
||||
public Models.IRD.File? Deserialize(string? path)
|
||||
{
|
||||
using (var stream = PathProcessor.OpenStream(path))
|
||||
{
|
||||
return new Streams.IRD().Deserialize(stream);
|
||||
}
|
||||
using var stream = PathProcessor.OpenStream(path);
|
||||
return new Streams.IRD().Deserialize(stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using SabreTools.Serialization.Interfaces;
|
||||
|
||||
namespace SabreTools.Serialization.Files
|
||||
{
|
||||
public partial class InstallShieldCabinet : IFileSerializer<Models.InstallShieldCabinet.Cabinet>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public Models.InstallShieldCabinet.Cabinet? Deserialize(string? path)
|
||||
{
|
||||
using var stream = PathProcessor.OpenStream(path);
|
||||
return new Streams.InstallShieldCabinet().Deserialize(stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using SabreTools.Serialization.Interfaces;
|
||||
|
||||
namespace SabreTools.Serialization.Files
|
||||
{
|
||||
public partial class InstallShieldCabinet : IFileSerializer<Models.InstallShieldCabinet.Cabinet>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Serialize(Models.InstallShieldCabinet.Cabinet? obj, string? path)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
return false;
|
||||
|
||||
using var stream = new Streams.InstallShieldCabinet().Serialize(obj);
|
||||
if (stream == null)
|
||||
return false;
|
||||
|
||||
using var fs = System.IO.File.OpenWrite(path);
|
||||
stream.CopyTo(fs);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,10 +22,8 @@ namespace SabreTools.Serialization.Files
|
||||
/// <returns>Filled object on success, null on error</returns>
|
||||
public T? Deserialize(string? path, Encoding encoding)
|
||||
{
|
||||
using (var data = PathProcessor.OpenStream(path))
|
||||
{
|
||||
return new Streams.JsonFile<T>().Deserialize(data, encoding);
|
||||
}
|
||||
using var data = PathProcessor.OpenStream(path);
|
||||
return new Streams.JsonFile<T>().Deserialize(data, encoding);
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user