saveSettings

Saves settings. Uses user's settings dir.

void
saveSettings
(
T
alias settingsFormat = SettingsFormat
)
(,
string name
,
string filename = settingsFilename
,
string subdir = ""
)

Parameters

data T

The data that will be saved to the settings file.

name string

The subdirectory of the settings dir to save the config to. Created if nonexistent.

filename string

The filename the settings will be saved to.

subdir string

The subdirectory that the settings will be saved in.

Examples

struct Settings {
	bool blah;
	string text;
	string[] texts;
}
saveSettings(Settings(true, "some words", ["c", "b", "a"]), "testapp", "settings", "subdir");

assert(loadSettings!Settings("testapp", "settings", "subdir") == Settings(true, "some words", ["c", "b", "a"]));

Meta