Which JSON is better? I already saw Vibe's JSON, but don't know where is
that new std.json.
Dňa 27. 2. 2013 22:36 Dicebot wrote / napísal(a):
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.