Yet another CT ini file parser: inifiled
Robert Schadek via Digitalmars-d-announce
digitalmars-d-announce at puremagic.com
Mon Jun 16 02:20:57 PDT 2014
On my way back from DConf I was bored with in the in-flight
entertainment and start to hack.
The result is "inifiled" a compile time ini file reader and writer that
fills and stores a annotated struct.
It excepts typical ini files with sections, comments and to some extend
nesting and arrays. The only
unique characteristic is that the struct and struct member annotations
require comments. Config
options without descriptive comments just make me troll. So comments for
options are required.
dub: http://code.dlang.org/packages/inifiled
github: https://github.com/burner/inifiled
@INI("A Person")
struct Person {
@INI("The lastname of the Person") string lastname;
@INI("The height of the Person") float height;
@INI("Some strings with a very long long INI description that is longer" ~
" than eigthy lines hopefully."
) string[] someStrings;
}
void main() {
Person person;
readINIFile(p, "filename.ini");
writeINIFile(p, "filename.ini");
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-announce/attachments/20140616/262374b0/attachment-0001.html>
More information about the Digitalmars-d-announce
mailing list