module

Egui::SystemPorts::AppConfig

Class methods

dir(app : String) : String

The directory holding an app's config files.

Source
load(app : String, default : T, name : String = "settings") : T forall T

Read a config by key, parsed as default's type (a JSON::Serializable); a missing file or corrupt JSON yields default — a bad settings file never keeps the app booting.

Source
path(app : String, name : String = "settings") : String

The file for one config of an app — "settings" becomes settings.json (a name already ending in .json is kept as is).

Source
save(app : String, config : T, name : String = "settings") : Nil forall T

Persist a config by key (its directory is created on demand). Best effort: on IO errors the app keeps running with the in-memory settings.

Source
use(base_dir : String | Nil) : Nil

Redirect all configs into base_dir (specs inject a temp dir; pass nil to return to the platform directory).

Source