I use this simple snippet to get quick and dirty key-value config:

---
string[string] data;
foreach( line; readText(filename).splitLines() )
{
    auto config_pair = array(
        filter!("a.length > 0")(
            map!(strip)(
                line.splitter("=")
            )
        )
    );
    data[config_pair[0]] = config_pair[1];
}
---

For anything even remotely complex I would have probably chosen JSON, either new std.json pending for review (not current std.json!) or vibe.data.json from vibed.org project.

Reply via email to