Added gittignore and deleted unused folders

This commit is contained in:
2026-01-21 16:16:09 -06:00
parent e0c24250fb
commit 5459eac680
26 changed files with 47 additions and 557 deletions

View File

@@ -1,6 +1,39 @@
using System.Text.Json;
using SzLib.DataObjects;
namespace SzLib;
public class SzParser(ISzFileManager szFileManager)
public class SzParser
{
public readonly ISzFileManager FileManager = szFileManager;
public readonly ISzFileManager FileManager;
private JsonSerializerOptions _jsonOptions = new()
{
WriteIndented = true,
};
public SzParser(ISzFileManager szFileManager)
{
FileManager = szFileManager;
}
public (string result, SzParseError error) SerializeDatasetToJson(SzDataset dataset)
{
try
{
var jsonString = JsonSerializer.Serialize(dataset, _jsonOptions);
return (jsonString, SzParseError.None);
}
catch (JsonException e)
{
return ("", SzParseError.CouldNotSerialize);
}
}
}
public enum SzParseError
{
None,
CouldNotSerialize,
GenericError,
}