CFG / INI file

S

salvage

Hi,

I am looking for an approach for reading configurationfiles - only using the
very basic C/C++ calls and classes (no fancy includes, which makes it
difficult for porting / using / implementing in the future).

I have written tonnes' of cfg readers in my time, and every time i need one,
i tend to write a completely new one, and im abit tired of that :O)

What would be really nice, was an XML reader - but the ones ive looked at
that is available, are way too big (even the small ones which normally is
shown in the NG's is too big).

The thing i need, which my previosly readers cannot do - is deviding
sections with subsections:

Ex (where a / b /c is sections - v is variables):

A
-B
-V
-V
--C
--V
--V
--V
--/C
-/B
/A

This is exactly what XML provides (i know XML is alot more - which also is
my problem, since the add-ons out there tend to implement all this too :) ).

Do any of you - either know a XML class / source that only is able to read /
and get the variables + data from sections - or do any of you have any
suggestions on what i should do ( i would be rather happy not to do a reader
more, its soooo boring).

Anyway - thanks alot.
 
J

Julie

salvage said:
Hi,

I am looking for an approach for reading configurationfiles - only using the
very basic C/C++ calls and classes (no fancy includes, which makes it
difficult for porting / using / implementing in the future).

I have written tonnes' of cfg readers in my time, and every time i need one,
i tend to write a completely new one, and im abit tired of that :O)

What would be really nice, was an XML reader - but the ones ive looked at
that is available, are way too big (even the small ones which normally is
shown in the NG's is too big).

The thing i need, which my previosly readers cannot do - is deviding
sections with subsections:

Ex (where a / b /c is sections - v is variables):

A
-B
-V
-V
--C
--V
--V
--V
--/C
-/B
/A

This is exactly what XML provides (i know XML is alot more - which also is
my problem, since the add-ons out there tend to implement all this too :) ).

Do any of you - either know a XML class / source that only is able to read /
and get the variables + data from sections - or do any of you have any
suggestions on what i should do ( i would be rather happy not to do a reader
more, its soooo boring).

Anyway - thanks alot.

Dr. Dobb's Journal had an article w/ source code on writing a mini XML parser:

Parsing XML
http://www.ddj.com/articles/2001/0101/

The included parser is *way* bare bones, but it does read XML and is pretty
easy to use. I successfully used it in an embedded project I was working on
after I found the other available sources (such as xerces) way to large for my
particular needs.

Source is composed of about 4-5 .cpp files and required only minor
modifications for my needs.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top