Class JsonFileStorage
- Namespace
- SharpConsoleUI.Registry
- Assembly
- SharpConsoleUI.dll
Default IRegistryStorage implementation. Persists the registry as a pretty-printed UTF-8 JSON file. Writes directly to the target path (no atomic rename — acceptable for user preferences and window state where data loss on crash is tolerable). Load() returns null if the file does not exist.
public class JsonFileStorage : IRegistryStorage
- Inheritance
-
JsonFileStorage
- Implements
- Inherited Members
- Extension Methods
Constructors
JsonFileStorage(string)
Initializes a new JsonFileStorage targeting the given file path.
public JsonFileStorage(string filePath)
Parameters
filePathstring
Methods
Load()
Loads the registry tree. Returns null if no data exists yet.
public JsonNode? Load()
Returns
Save(JsonNode)
Persists the registry tree.
public void Save(JsonNode root)
Parameters
rootJsonNode