Best way to handle settings files (ini file syntax or similar)

Lubos Pintes lubos.pintes at gmail.com
Thu Feb 28 04:45:42 PST 2013


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.



More information about the Digitalmars-d-learn mailing list