Datasets now serialize/save and deserialize/load properly. Created a test in the CLI project

This commit is contained in:
2026-01-21 22:31:18 -06:00
parent dc7ddc0c6c
commit ad2e074991
10 changed files with 169 additions and 46 deletions

34
SzCli/LocalFileManager.cs Normal file
View File

@@ -0,0 +1,34 @@
using SzLib;
namespace SzCli;
public class LocalFileManager : ISzFileManager
{
public string DataPath
{
get
{
var path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "data");
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
return path;
}
}
public bool SaveFile(string path, string fileContent)
{
try
{
File.WriteAllText(path, fileContent);
return true;
}
catch (Exception e)
{
Console.WriteLine($"Error saving file: {e.Message}");
return false;
}
}
}