Adding nix shell and reworking some parser/local file manager stuff
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
namespace SzLib;
|
||||
|
||||
public class Class1
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,8 +1,12 @@
|
||||
using SzLib.DataObjects;
|
||||
|
||||
namespace SzLib;
|
||||
|
||||
public interface ISzFileManager
|
||||
{
|
||||
{
|
||||
public string DataPath {get;}
|
||||
|
||||
public string DatasetsPath {get;}
|
||||
|
||||
public bool SaveFile(string path, string fileContent);
|
||||
}
|
||||
public string? LoadFile(string path);
|
||||
}
|
||||
|
||||
@@ -35,13 +35,12 @@ public class SzParser(ISzFileManager szFileManager)
|
||||
|
||||
public bool SaveDataset(SzDataset dataset)
|
||||
{
|
||||
var datasetDir = Path.Combine(szFileManager.DataPath, "datasets", dataset.Id);
|
||||
Directory.CreateDirectory(datasetDir);
|
||||
var datasetDir = Path.Combine(szFileManager.DatasetsPath, dataset.Id);
|
||||
|
||||
try
|
||||
{
|
||||
var json = SerializeDatasetToJson(dataset);
|
||||
File.WriteAllText(Path.Combine(datasetDir, "dataset.json"), json);
|
||||
return true;
|
||||
return szFileManager.SaveFile(Path.Combine(datasetDir, "dataset.json"), json);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user