August 25, 2013 Range-based INI parser | ||||
---|---|---|---|---|
| ||||
Playing around with ranges I built [0] a little parser for INI files [1]. It does not support multiline values, since then I cannot do the line splitting in a different component. Any good architecture ideas here? The thing with INI is that the definition is fuzzy. This means the parser should be highly configurable. What symbols for key-value-separation? What symbol for comments? Case sensitivity? Etc. I used template parameters for configuration, since that should be best for performance. Better ideas? I like my idea to output a range of (section,key,value) items. This lets the user decide, what to do with duplicate keys and avoids data structures for sections. Would something like this be a good idea for Phobos? [0] http://dpaste.dzfl.pl/1b29ef20 [1] http://en.wikipedia.org/wiki/INI_file |
Copyright © 1999-2021 by the D Language Foundation