Has anyone written an INI parser in tango?

Bill Baxter wbaxter at gmail.com
Fri Sep 12 01:17:55 PDT 2008


On Fri, Sep 12, 2008 at 3:43 PM, Chris R. Miller
<lordsauronthegreat at gmail.com> wrote:
> Bill Baxter wrote:
>> On Fri, Sep 12, 2008 at 9:38 AM, Rayne <DiscipleRayne at gmail.com> wrote:
>>> Just wondering if anyone had because it doesnt seen that the creators of Tango have, and their crappy properties stuff doesnt appeal to me in the least bit.
>>
>> Is there some reason you are really set on using a crappy format like ini?
>
> What's so bad about ini?
>
> 1) It's simple.  Even people with little to no computer savvy can look
> at an ini file and deduce how to make things work.
>
> 2) It's easy to parse.
>
> 3) It's not platform-dependent.  Using the line iterator in Tango you
> don't even have to be cognizant of the differences between /r/n and /n.
>  Just go!
>
> 4) It's simple enough to be edited from a command-line editor.

It's not hierarchical.

But you're right, if you never have any plans to go beyond very simple
key=value uses, then it's fine.  But if that's all you need then maybe
you don't even need ini.  Just a file with plain old
----
foo = bar
x = y
----
will do and you can just read the lines with a simple regex.

That said I don't know the full spec of the ini format.  So maybe it
has some tricks I'm not aware of.

--bb



More information about the Digitalmars-d mailing list