Re: [RFC] Ini parser

2015-01-20 Thread Suliman via Digitalmars-d
It would be nice to add overload of getKey method so you can use something like this: this.optionalkey = config.getKey("key1", "defaultValue"); it's need for set default value if needed value can't be found on config.

Re: [RFC] Ini parser

2012-02-29 Thread Stewart Gordon
On 29/02/2012 12:24, bioinfornatics wrote: They are all you want here: http://sourceforge.net/apps/trac/chaoslizard/wiki/Docs/Ni/FileFormat So it's somewhat more complex than the Windows .ini format. What's more, it isn't compatible with the Windows .ini format, under which backslashes (e.g.

Re: [RFC] Ini parser

2012-02-29 Thread Jesse Phillips
On Sunday, 26 February 2012 at 15:56:50 UTC, H. S. Teoh wrote: Just a quick follow up on: https://github.com/D-Programming-Language/phobos/pull/449 I wasn't aware that .ini was deprecated by Microsoft. What's their touted replacement for it? XML Also, I know that there are applications out

Re: [RFC] Ini parser

2012-02-29 Thread bioinfornatics
Le mardi 28 février 2012 à 23:45 +, Stewart Gordon a écrit : > On 27/02/2012 14:20, bioinfornatics wrote: > > > the code support default .ini spec and in more allow to have subsection > > Where is this format called "default .ini" defined exactly? > > And where is the superset of "default .i

Re: [RFC] Ini parser

2012-02-28 Thread Stewart Gordon
On 27/02/2012 14:20, bioinfornatics wrote: the code support default .ini spec and in more allow to have subsection Where is this format called "default .ini" defined exactly? And where is the superset of "default .ini" that has subsections defined exactly? Stewart.

Re: [RFC] Ini parser

2012-02-27 Thread bioinfornatics
Le lundi 27 février 2012 à 13:44 +, Stewart Gordon a écrit : > On 26/02/2012 15:58, H. S. Teoh wrote: > > Just a quick follow up on: > > > > https://github.com/D-Programming-Language/phobos/pull/449 > > > > I wasn't aware that .ini was deprecated by Microsoft. What's their > > touted replacemen

Re: [RFC] Ini parser

2012-02-27 Thread Stewart Gordon
On 26/02/2012 15:58, H. S. Teoh wrote: Just a quick follow up on: https://github.com/D-Programming-Language/phobos/pull/449 I wasn't aware that .ini was deprecated by Microsoft. What's their touted replacement for it? The registry. Besides, the code you've linked to seems to me to be an impl

[RFC] Ini parser

2012-02-26 Thread H. S. Teoh
Just a quick follow up on: https://github.com/D-Programming-Language/phobos/pull/449 I wasn't aware that .ini was deprecated by Microsoft. What's their touted replacement for it? Also, I know that there are applications out there that use the .ini format, even though they aren't specific to Wind

Re: [RFC] ini parser

2012-02-22 Thread bioinfornatics
update (minor) I have do a pull request here: https://github.com/D-Programming-Language/phobos/pull/449

[RFC] ini parser

2012-02-22 Thread bioinfornatics
I have wrote a ini parser it can use bidirectional range example of ini file able to parse: ___ [sectionA] param1=value1 param2=value2 [[subSectionA]] param1sub=value1sub [sectionB] param3=value3 ; I am a comment param4=value4 [se

Re: [RFC] Ini parser

2012-02-21 Thread bioinfornatics
I have wrote a ini parser it can use bidirectional range example of ini file able to parse: ___ [sectionA] param1=value1 param2=value2 [[subSectionA]] param1sub=value1sub [sectionB] param3=value3 ; I am a comment param4=value4 [se

Re: [RFC] Ini parser

2012-02-17 Thread Robert Jacques
On Thu, 16 Feb 2012 14:50:22 -0600, Robik wrote: Greetings. [snip] // write foo.name1 value writeln(ini.getSection("foo")["name1"].value); I'd recommend using opDispatch to enable the following syntax: writeln( ini.foo.name1 ); Skimming the code, I see a lot of re-implemen

Re: [RFC] Ini parser

2012-02-17 Thread Robik
On Friday, 17 February 2012 at 07:27:52 UTC, Jacob Carlborg wrote: On 2012-02-16 21:50, Robik wrote: Greetings. Recently, I've been working on INI parser in D. The main goals were to keep code easy and well documented. Suggestions are really welcome(main reason of this thread) because it nee

Re: [RFC] Ini parser

2012-02-17 Thread Robik
On Thursday, 16 February 2012 at 22:29:30 UTC, Manu wrote: I wonder if there is a problem with a 'standard' ini parser, in that ini files are not really very standard. I have seen a lot of ini files with scope (also also use this in some of my own apps), will I be able to parse these with your

Re: [RFC] Ini parser

2012-02-17 Thread Robik
On Thursday, 16 February 2012 at 22:29:30 UTC, Manu wrote: I wonder if there is a problem with a 'standard' ini parser, in that ini files are not really very standard. I have seen a lot of ini files with scope (also also use this in some of my own apps), will I be able to parse these with your

Re: [RFC] Ini parser

2012-02-16 Thread Jacob Carlborg
On 2012-02-16 21:50, Robik wrote: Greetings. Recently, I've been working on INI parser in D. The main goals were to keep code easy and well documented. Suggestions are really welcome(main reason of this thread) because it needs polishing and stuff. It provides simple interface for operating on

Re: [RFC] Ini parser

2012-02-16 Thread Vladimir Panteleev
On Thursday, 16 February 2012 at 22:29:30 UTC, Manu wrote: I have seen a lot of ini files with scope (also also use this in some of my own apps), will I be able to parse these with your parser? I've never seen such a file. What software (other than yours) uses it?

Re: [RFC] Ini parser

2012-02-16 Thread Manu
On 17 February 2012 01:57, Marco Leise wrote: > Am 16.02.2012, 23:34 Uhr, schrieb Sean Kelly : > > > At this point you may as well just use JSON. >> > > Listen to this guy, he's right. JSON allows hierarchies and arrays, > strings, numbers and booleans as values. It is clearly defined and as > l

Re: [RFC] Ini parser

2012-02-16 Thread Manu
True, but JSON didn't exist/wasn't well known when these formats were in use. On 17 February 2012 00:34, Sean Kelly wrote: > At this point you may as well just use JSON. > > On Feb 16, 2012, at 2:29 PM, Manu wrote: > > > I wonder if there is a problem with a 'standard' ini parser, in that ini >

Re: [RFC] Ini parser

2012-02-16 Thread Marco Leise
Am 16.02.2012, 23:34 Uhr, schrieb Sean Kelly : At this point you may as well just use JSON. Listen to this guy, he's right. JSON allows hierarchies and arrays, strings, numbers and booleans as values. It is clearly defined and as light-weight as an INI file (compared to XML). I stored game r

Re: [RFC] Ini parser

2012-02-16 Thread Sean Kelly
At this point you may as well just use JSON. On Feb 16, 2012, at 2:29 PM, Manu wrote: > I wonder if there is a problem with a 'standard' ini parser, in that ini > files are not really very standard. > I have seen a lot of ini files with scope (also also use this in some of my > own apps), will

Re: [RFC] Ini parser

2012-02-16 Thread Manu
I wonder if there is a problem with a 'standard' ini parser, in that ini files are not really very standard. I have seen a lot of ini files with scope (also also use this in some of my own apps), will I be able to parse these with your parser? [section] { key = value key2 = value [subsectio

Re: [RFC] Ini parser

2012-02-16 Thread Nathan M. Swan
On Thursday, 16 February 2012 at 20:50:23 UTC, Robik wrote: Feel free to share suggestions, changes, help me make it better :). It's great, I think I could find uses for it. One thing that confuses me about the implementation is that the IniSection has an array of key-value pairs. I think

[RFC] Ini parser

2012-02-16 Thread Robik
Greetings. Recently, I've been working on INI parser in D. The main goals were to keep code easy and well documented. Suggestions are really welcome(main reason of this thread) because it needs polishing and stuff. It provides simple interface for operating on parsed file, including useful