 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
salvage Guest
|
Posted: Fri Mar 05, 2004 3:40 pm Post subject: CFG / INI file |
|
|
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.
|
|
| Back to top |
|
 |
Julie Guest
|
Posted: Fri Mar 05, 2004 4:02 pm Post subject: Re: CFG / INI file |
|
|
salvage wrote:
| Quote: |
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.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|