ConfigsTrait

Undocumented in source.

Members

Functions

init
void init(string ini_filename)
Undocumented in source. Be warned that the author may not have intended to support it.
init
void init(File ini_file)
Undocumented in source. Be warned that the author may not have intended to support it.
initSrc
void initSrc(string src)
Undocumented in source. Be warned that the author may not have intended to support it.

Mixins

__anonymous
mixin setField!mmbr_name
Undocumented in source.

Examples

////////////////////////////////////////////////////

string ini = `
    value1 = Some text           
    value2 = 9856428642
`;

static struct AppConfigsDefault
{
    enum string value1 = "Ultimate Question of Life, the Universe, and Everything";
    enum size_t value2 = 42;
}
alias AppConfigs = ConfigsTrait!AppConfigsDefault;


AppConfigs cfg;
assert(cfg.value1 == AppConfigsDefault.value1);
assert(cfg.value2 == AppConfigsDefault.value2);


try {
    cfg.initSrc (ini);
} catch (IniConfigsException e) {
    assert(0);
}

assert(cfg.value1 == "Some text");
assert(cfg.value2 == 9856428642);

Meta