diff --git a/InfoPrint/Features/MainFeature.cs b/InfoPrint/Features/MainFeature.cs index 4e2260bb..9bb64c46 100644 --- a/InfoPrint/Features/MainFeature.cs +++ b/InfoPrint/Features/MainFeature.cs @@ -35,10 +35,8 @@ namespace InfoPrint.Features private const string _hashName = "hash"; internal readonly FlagInput HashInput = new(_hashName, ["-c", "--hash"], "Output file hashes"); -#if NETCOREAPP private const string _jsonName = "json"; internal readonly FlagInput JsonInput = new(_jsonName, ["-j", "--json"], "Print info as JSON"); -#endif #endregion @@ -57,12 +55,10 @@ namespace InfoPrint.Features /// public bool Hash { get; private set; } -#if NETCOREAPP /// /// Enable JSON output /// public bool Json { get; private set; } -#endif public MainFeature() : base(DisplayName, _flags, _description) @@ -72,9 +68,7 @@ namespace InfoPrint.Features Add(DebugInput); Add(HashInput); Add(FileOnlyInput); -#if NETCOREAPP Add(JsonInput); -#endif } /// @@ -84,9 +78,7 @@ namespace InfoPrint.Features Debug = GetBoolean(_debugName); Hash = GetBoolean(_hashName); FileOnly = GetBoolean(_fileOnlyName); -#if NETCOREAPP Json = GetBoolean(_jsonName); -#endif // Loop through the input paths for (int i = 0; i < Inputs.Count; i++) @@ -187,7 +179,6 @@ namespace InfoPrint.Features return; } -#if NETCOREAPP // If we have the JSON flag if (Json) { @@ -199,7 +190,6 @@ namespace InfoPrint.Features jsw.WriteLine(serializedData); jsw.Flush(); } -#endif // Create the output data var builder = new StringBuilder(); diff --git a/README.MD b/README.MD index 041bce85..37dda3a4 100644 --- a/README.MD +++ b/README.MD @@ -14,7 +14,7 @@ For the latest WIP build here: [Rolling Release](https://github.com/SabreTools/S ## InfoPrint -**InfoPrint** is a reference implementation for the deserialization and printing features of the library, packaged as a standalone executable for all supported platforms. It will attempt to detect and display information about many supported file types, optionally both hashing the file and outputting the information to a JSON file (.NET Core 3.1 and above only). +**InfoPrint** is a reference implementation for the deserialization and printing features of the library, packaged as a standalone executable for all supported platforms. It will attempt to detect and display information about many supported file types, optionally both hashing the file and outputting the information to a JSON file. ```text InfoPrint file|directory ... diff --git a/SabreTools.Wrappers/AACSMediaKeyBlock.Printing.cs b/SabreTools.Wrappers/AACSMediaKeyBlock.Printing.cs index f5197456..6cf95229 100644 --- a/SabreTools.Wrappers/AACSMediaKeyBlock.Printing.cs +++ b/SabreTools.Wrappers/AACSMediaKeyBlock.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/Atari7800Cart.Printing.cs b/SabreTools.Wrappers/Atari7800Cart.Printing.cs index 5209bdb4..988905ac 100644 --- a/SabreTools.Wrappers/Atari7800Cart.Printing.cs +++ b/SabreTools.Wrappers/Atari7800Cart.Printing.cs @@ -10,6 +10,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/AtariLynxCart.Printing.cs b/SabreTools.Wrappers/AtariLynxCart.Printing.cs index ed4361c4..5231b3a4 100644 --- a/SabreTools.Wrappers/AtariLynxCart.Printing.cs +++ b/SabreTools.Wrappers/AtariLynxCart.Printing.cs @@ -10,6 +10,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/BDPlusSVM.Printing.cs b/SabreTools.Wrappers/BDPlusSVM.Printing.cs index 9f38a6af..99fcdfc0 100644 --- a/SabreTools.Wrappers/BDPlusSVM.Printing.cs +++ b/SabreTools.Wrappers/BDPlusSVM.Printing.cs @@ -8,6 +8,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/BFPK.Printing.cs b/SabreTools.Wrappers/BFPK.Printing.cs index 6979974a..f4d6b151 100644 --- a/SabreTools.Wrappers/BFPK.Printing.cs +++ b/SabreTools.Wrappers/BFPK.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/BSP.Printing.cs b/SabreTools.Wrappers/BSP.Printing.cs index 654601b4..f0467160 100644 --- a/SabreTools.Wrappers/BSP.Printing.cs +++ b/SabreTools.Wrappers/BSP.Printing.cs @@ -10,6 +10,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/CFB.Printing.cs b/SabreTools.Wrappers/CFB.Printing.cs index bcec7509..bf177f06 100644 --- a/SabreTools.Wrappers/CFB.Printing.cs +++ b/SabreTools.Wrappers/CFB.Printing.cs @@ -10,6 +10,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/CHD.Printing.cs b/SabreTools.Wrappers/CHD.Printing.cs index 9ed86135..200aff3e 100644 --- a/SabreTools.Wrappers/CHD.Printing.cs +++ b/SabreTools.Wrappers/CHD.Printing.cs @@ -11,6 +11,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/CIA.Printing.cs b/SabreTools.Wrappers/CIA.Printing.cs index 675b1ee1..da1d8e89 100644 --- a/SabreTools.Wrappers/CIA.Printing.cs +++ b/SabreTools.Wrappers/CIA.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/FDS.Printing.cs b/SabreTools.Wrappers/FDS.Printing.cs index 2df527bf..dca4aa93 100644 --- a/SabreTools.Wrappers/FDS.Printing.cs +++ b/SabreTools.Wrappers/FDS.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/GCF.Printing.cs b/SabreTools.Wrappers/GCF.Printing.cs index 4b8dae8b..1dcbee31 100644 --- a/SabreTools.Wrappers/GCF.Printing.cs +++ b/SabreTools.Wrappers/GCF.Printing.cs @@ -10,6 +10,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/GZip.Printing.cs b/SabreTools.Wrappers/GZip.Printing.cs index 5426a0b7..d2818ae7 100644 --- a/SabreTools.Wrappers/GZip.Printing.cs +++ b/SabreTools.Wrappers/GZip.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/IPrintable.cs b/SabreTools.Wrappers/IPrintable.cs index 15a41911..b01ed3a8 100644 --- a/SabreTools.Wrappers/IPrintable.cs +++ b/SabreTools.Wrappers/IPrintable.cs @@ -7,12 +7,10 @@ namespace SabreTools.Wrappers /// public interface IPrintable { -#if NETCOREAPP /// /// Export the item information as JSON /// public string ExportJSON(); -#endif /// /// Print information associated with a model diff --git a/SabreTools.Wrappers/IRD.Printing.cs b/SabreTools.Wrappers/IRD.Printing.cs index da1654d8..c7af9e60 100644 --- a/SabreTools.Wrappers/IRD.Printing.cs +++ b/SabreTools.Wrappers/IRD.Printing.cs @@ -8,6 +8,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/ISO9660.Printing.cs b/SabreTools.Wrappers/ISO9660.Printing.cs index b67e5eb3..340a9ecf 100644 --- a/SabreTools.Wrappers/ISO9660.Printing.cs +++ b/SabreTools.Wrappers/ISO9660.Printing.cs @@ -12,6 +12,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/InstallShieldArchiveV3.Printing.cs b/SabreTools.Wrappers/InstallShieldArchiveV3.Printing.cs index 98b6091e..b36ff253 100644 --- a/SabreTools.Wrappers/InstallShieldArchiveV3.Printing.cs +++ b/SabreTools.Wrappers/InstallShieldArchiveV3.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/InstallShieldCabinet.Printing.cs b/SabreTools.Wrappers/InstallShieldCabinet.Printing.cs index 2078fa91..cb9f4827 100644 --- a/SabreTools.Wrappers/InstallShieldCabinet.Printing.cs +++ b/SabreTools.Wrappers/InstallShieldCabinet.Printing.cs @@ -10,6 +10,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/LZKWAJ.Printing.cs b/SabreTools.Wrappers/LZKWAJ.Printing.cs index 73507cbd..6d81e096 100644 --- a/SabreTools.Wrappers/LZKWAJ.Printing.cs +++ b/SabreTools.Wrappers/LZKWAJ.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/LZQBasic.Printing.cs b/SabreTools.Wrappers/LZQBasic.Printing.cs index e689e94b..fbecfff2 100644 --- a/SabreTools.Wrappers/LZQBasic.Printing.cs +++ b/SabreTools.Wrappers/LZQBasic.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/LZSZDD.Printing.cs b/SabreTools.Wrappers/LZSZDD.Printing.cs index 62f09f03..65821c19 100644 --- a/SabreTools.Wrappers/LZSZDD.Printing.cs +++ b/SabreTools.Wrappers/LZSZDD.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/LinearExecutable.Printing.cs b/SabreTools.Wrappers/LinearExecutable.Printing.cs index 6b0d1b86..2420d7f2 100644 --- a/SabreTools.Wrappers/LinearExecutable.Printing.cs +++ b/SabreTools.Wrappers/LinearExecutable.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/MSDOS.Printing.cs b/SabreTools.Wrappers/MSDOS.Printing.cs index d38a4e07..f9ab3f3a 100644 --- a/SabreTools.Wrappers/MSDOS.Printing.cs +++ b/SabreTools.Wrappers/MSDOS.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/MicrosoftCabinet.Printing.cs b/SabreTools.Wrappers/MicrosoftCabinet.Printing.cs index e20170a3..5281189a 100644 --- a/SabreTools.Wrappers/MicrosoftCabinet.Printing.cs +++ b/SabreTools.Wrappers/MicrosoftCabinet.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/MoPaQ.Printing.cs b/SabreTools.Wrappers/MoPaQ.Printing.cs index 0a0b53e7..05e6e095 100644 --- a/SabreTools.Wrappers/MoPaQ.Printing.cs +++ b/SabreTools.Wrappers/MoPaQ.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/N3DS.Printing.cs b/SabreTools.Wrappers/N3DS.Printing.cs index 11c1de91..fc487fb4 100644 --- a/SabreTools.Wrappers/N3DS.Printing.cs +++ b/SabreTools.Wrappers/N3DS.Printing.cs @@ -10,6 +10,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/NCF.Printing.cs b/SabreTools.Wrappers/NCF.Printing.cs index 222e7b1b..8f9190b3 100644 --- a/SabreTools.Wrappers/NCF.Printing.cs +++ b/SabreTools.Wrappers/NCF.Printing.cs @@ -10,6 +10,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/NESCart.Printing.cs b/SabreTools.Wrappers/NESCart.Printing.cs index 26e1dd6f..2b5563b9 100644 --- a/SabreTools.Wrappers/NESCart.Printing.cs +++ b/SabreTools.Wrappers/NESCart.Printing.cs @@ -10,6 +10,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/NewExecutable.Printing.cs b/SabreTools.Wrappers/NewExecutable.Printing.cs index cbf75e0b..090dc33c 100644 --- a/SabreTools.Wrappers/NewExecutable.Printing.cs +++ b/SabreTools.Wrappers/NewExecutable.Printing.cs @@ -11,6 +11,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/Nitro.Printing.cs b/SabreTools.Wrappers/Nitro.Printing.cs index ff9c20e7..0ab411e3 100644 --- a/SabreTools.Wrappers/Nitro.Printing.cs +++ b/SabreTools.Wrappers/Nitro.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/OperaFS.Printing.cs b/SabreTools.Wrappers/OperaFS.Printing.cs index 53563a47..967cd68f 100644 --- a/SabreTools.Wrappers/OperaFS.Printing.cs +++ b/SabreTools.Wrappers/OperaFS.Printing.cs @@ -11,6 +11,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/PAK.Printing.cs b/SabreTools.Wrappers/PAK.Printing.cs index 12b274c6..cc51d88b 100644 --- a/SabreTools.Wrappers/PAK.Printing.cs +++ b/SabreTools.Wrappers/PAK.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/PFF.Printing.cs b/SabreTools.Wrappers/PFF.Printing.cs index 7efa505c..7d6a7005 100644 --- a/SabreTools.Wrappers/PFF.Printing.cs +++ b/SabreTools.Wrappers/PFF.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/PIC.Printing.cs b/SabreTools.Wrappers/PIC.Printing.cs index 6197bcca..d42b3487 100644 --- a/SabreTools.Wrappers/PIC.Printing.cs +++ b/SabreTools.Wrappers/PIC.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/PKZIP.Printing.cs b/SabreTools.Wrappers/PKZIP.Printing.cs index 91d55d78..c15096f8 100644 --- a/SabreTools.Wrappers/PKZIP.Printing.cs +++ b/SabreTools.Wrappers/PKZIP.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/PlayJAudioFile.Printing.cs b/SabreTools.Wrappers/PlayJAudioFile.Printing.cs index caeeddb8..200a79ca 100644 --- a/SabreTools.Wrappers/PlayJAudioFile.Printing.cs +++ b/SabreTools.Wrappers/PlayJAudioFile.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/PlayJPlaylist.Printing.cs b/SabreTools.Wrappers/PlayJPlaylist.Printing.cs index b246e742..b8fd350c 100644 --- a/SabreTools.Wrappers/PlayJPlaylist.Printing.cs +++ b/SabreTools.Wrappers/PlayJPlaylist.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/PortableExecutable.Printing.cs b/SabreTools.Wrappers/PortableExecutable.Printing.cs index 74510ba2..807fa541 100644 --- a/SabreTools.Wrappers/PortableExecutable.Printing.cs +++ b/SabreTools.Wrappers/PortableExecutable.Printing.cs @@ -19,6 +19,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/QD.Printing.cs b/SabreTools.Wrappers/QD.Printing.cs index ffa618c3..063aaddf 100644 --- a/SabreTools.Wrappers/QD.Printing.cs +++ b/SabreTools.Wrappers/QD.Printing.cs @@ -8,6 +8,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/Quantum.Printing.cs b/SabreTools.Wrappers/Quantum.Printing.cs index 040d8c88..8653b1f5 100644 --- a/SabreTools.Wrappers/Quantum.Printing.cs +++ b/SabreTools.Wrappers/Quantum.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/SFFS.Printing.cs b/SabreTools.Wrappers/SFFS.Printing.cs index 54d8a8f1..c37c5f1a 100644 --- a/SabreTools.Wrappers/SFFS.Printing.cs +++ b/SabreTools.Wrappers/SFFS.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/SGA.Printing.cs b/SabreTools.Wrappers/SGA.Printing.cs index f2645acb..e45d3305 100644 --- a/SabreTools.Wrappers/SGA.Printing.cs +++ b/SabreTools.Wrappers/SGA.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/STFS.Printing.cs b/SabreTools.Wrappers/STFS.Printing.cs index 0eea3a04..6448d8ba 100644 --- a/SabreTools.Wrappers/STFS.Printing.cs +++ b/SabreTools.Wrappers/STFS.Printing.cs @@ -10,6 +10,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/SecuROMDFA.Printing.cs b/SabreTools.Wrappers/SecuROMDFA.Printing.cs index cccbe1d7..0bd0bb69 100644 --- a/SabreTools.Wrappers/SecuROMDFA.Printing.cs +++ b/SabreTools.Wrappers/SecuROMDFA.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/SecuROMMatroschkaPackage.Printing.cs b/SabreTools.Wrappers/SecuROMMatroschkaPackage.Printing.cs index d296170b..dbb5dbb3 100644 --- a/SabreTools.Wrappers/SecuROMMatroschkaPackage.Printing.cs +++ b/SabreTools.Wrappers/SecuROMMatroschkaPackage.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/TapeArchive.Printing.cs b/SabreTools.Wrappers/TapeArchive.Printing.cs index 70523a2c..7d8c3ab5 100644 --- a/SabreTools.Wrappers/TapeArchive.Printing.cs +++ b/SabreTools.Wrappers/TapeArchive.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/VBSP.Printing.cs b/SabreTools.Wrappers/VBSP.Printing.cs index 1086e436..890e3d68 100644 --- a/SabreTools.Wrappers/VBSP.Printing.cs +++ b/SabreTools.Wrappers/VBSP.Printing.cs @@ -10,6 +10,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/VPK.Printing.cs b/SabreTools.Wrappers/VPK.Printing.cs index 2d8893c6..1afb9f2b 100644 --- a/SabreTools.Wrappers/VPK.Printing.cs +++ b/SabreTools.Wrappers/VPK.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/WAD3.Printing.cs b/SabreTools.Wrappers/WAD3.Printing.cs index e8ee1c31..b1edfffc 100644 --- a/SabreTools.Wrappers/WAD3.Printing.cs +++ b/SabreTools.Wrappers/WAD3.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/WiseOverlayHeader.Printing.cs b/SabreTools.Wrappers/WiseOverlayHeader.Printing.cs index 1d736734..7d2ea1d7 100644 --- a/SabreTools.Wrappers/WiseOverlayHeader.Printing.cs +++ b/SabreTools.Wrappers/WiseOverlayHeader.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/WiseScript.Printing.cs b/SabreTools.Wrappers/WiseScript.Printing.cs index ee49cff7..8e3178c1 100644 --- a/SabreTools.Wrappers/WiseScript.Printing.cs +++ b/SabreTools.Wrappers/WiseScript.Printing.cs @@ -12,6 +12,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/WiseSectionHeader.Printing.cs b/SabreTools.Wrappers/WiseSectionHeader.Printing.cs index 0129c8d8..258c8de6 100644 --- a/SabreTools.Wrappers/WiseSectionHeader.Printing.cs +++ b/SabreTools.Wrappers/WiseSectionHeader.Printing.cs @@ -8,6 +8,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/WrapperBase.cs b/SabreTools.Wrappers/WrapperBase.cs index a272759b..a3b48677 100644 --- a/SabreTools.Wrappers/WrapperBase.cs +++ b/SabreTools.Wrappers/WrapperBase.cs @@ -36,8 +36,8 @@ namespace SabreTools.Wrappers /// protected readonly ReadOnlyViewStream _dataSource; -#if NETCOREAPP #pragma warning disable IDE1006 // Naming Styles +#if NETCOREAPP /// /// JSON serializer options for output printing /// @@ -56,8 +56,26 @@ namespace SabreTools.Wrappers return serializer; } } -#pragma warning restore IDE1006 +#else + /// + /// JSON serializer options for output printing + /// + protected static Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions + { + get + { + var serializer = new Newtonsoft.Json.JsonSerializerSettings + { + Formatting = Newtonsoft.Json.Formatting.Indented, + }; + // TODO: Figure out how to port ConcreteAbstractSerializer + // TODO: Figure out how to port ConcreteInterfaceSerializer + serializer.Converters.Add(new Newtonsoft.Json.Converters.StringEnumConverter()); + return serializer; + } + } #endif +#pragma warning restore IDE1006 /// /// Lock for accessing diff --git a/SabreTools.Wrappers/XDVDFS.Printing.cs b/SabreTools.Wrappers/XDVDFS.Printing.cs index 334d060a..cc77969c 100644 --- a/SabreTools.Wrappers/XDVDFS.Printing.cs +++ b/SabreTools.Wrappers/XDVDFS.Printing.cs @@ -10,6 +10,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/XMID.Printing.cs b/SabreTools.Wrappers/XMID.Printing.cs index aa5ed02e..73f5c4fd 100644 --- a/SabreTools.Wrappers/XMID.Printing.cs +++ b/SabreTools.Wrappers/XMID.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/XRD.Printing.cs b/SabreTools.Wrappers/XRD.Printing.cs index d7d5b22f..f895653b 100644 --- a/SabreTools.Wrappers/XRD.Printing.cs +++ b/SabreTools.Wrappers/XRD.Printing.cs @@ -8,6 +8,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/XZ.Printing.cs b/SabreTools.Wrappers/XZ.Printing.cs index 16b68778..039310c0 100644 --- a/SabreTools.Wrappers/XZ.Printing.cs +++ b/SabreTools.Wrappers/XZ.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/XZP.Printing.cs b/SabreTools.Wrappers/XZP.Printing.cs index 7d19d0fe..f26031be 100644 --- a/SabreTools.Wrappers/XZP.Printing.cs +++ b/SabreTools.Wrappers/XZP.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/XboxExecutable.Printing.cs b/SabreTools.Wrappers/XboxExecutable.Printing.cs index 1b5b207a..8641598a 100644 --- a/SabreTools.Wrappers/XboxExecutable.Printing.cs +++ b/SabreTools.Wrappers/XboxExecutable.Printing.cs @@ -11,6 +11,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/XboxISO.Printing.cs b/SabreTools.Wrappers/XboxISO.Printing.cs index e4954700..120236fb 100644 --- a/SabreTools.Wrappers/XboxISO.Printing.cs +++ b/SabreTools.Wrappers/XboxISO.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/XeMID.Printing.cs b/SabreTools.Wrappers/XeMID.Printing.cs index a50d7406..176a4229 100644 --- a/SabreTools.Wrappers/XeMID.Printing.cs +++ b/SabreTools.Wrappers/XeMID.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/XenonExecutable.Printing.cs b/SabreTools.Wrappers/XenonExecutable.Printing.cs index 9546d7d0..6d01a38e 100644 --- a/SabreTools.Wrappers/XenonExecutable.Printing.cs +++ b/SabreTools.Wrappers/XenonExecutable.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif /// diff --git a/SabreTools.Wrappers/ZArchive.Printing.cs b/SabreTools.Wrappers/ZArchive.Printing.cs index e5b27e02..002dc057 100644 --- a/SabreTools.Wrappers/ZArchive.Printing.cs +++ b/SabreTools.Wrappers/ZArchive.Printing.cs @@ -9,6 +9,9 @@ namespace SabreTools.Wrappers #if NETCOREAPP /// public string ExportJSON() => System.Text.Json.JsonSerializer.Serialize(Model, _jsonSerializerOptions); +#else + /// + public string ExportJSON() => Newtonsoft.Json.JsonConvert.SerializeObject(Model, _jsonSerializerOptions); #endif ///