C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CFG / INI file

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
salvage
Guest





PostPosted: Fri Mar 05, 2004 3:40 pm    Post subject: CFG / INI file Reply with 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 Smile ).

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





PostPosted: Fri Mar 05, 2004 4:02 pm    Post subject: Re: CFG / INI file Reply with quote



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 Smile ).

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
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.