473,396 Members | 2,158 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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.
Jul 22 '05 #1
1 4571
salvage wrote:

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.
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give...
5
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. ...
18
by: Dino | last post by:
dear all, i've created an application for a customer where the customer can upload ..csv-files into a specified ftp-directory. on the server, a php-script, triggered by a cronjob, reads all the...
0
by: chris | last post by:
I'm writing a small app to help me learn more about cryptography. All it does is encrypt all of the files in directory A, and put the encrypted versions of the files in directory B. It then...
5
by: simon place | last post by:
is the code below meant to produce rubbish?, i had expected an exception. f=file('readme.txt','w') f.write(' ') f.read() ( PythonWin 2.3 (#46, Jul 29 2003, 18:54:32) on win32. ) I got...
7
by: Joseph | last post by:
Hi, I'm having bit of questions on recursive pointer. I have following code that supports upto 8K files but when i do a file like 12K i get a segment fault. I Know it is in this line of code. ...
3
by: StGo | last post by:
How can i read/write file's custom attributs(like subject,author...) in C#??? Thanks :))
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
1
by: Mika M | last post by:
I have made Setup and Deployment Project for my application. This application uses couble of Crysral Report .rpt -files, so I included following into Setup and Deployment Project ... -...
0
by: thjwong | last post by:
I'm using WinXP with Microsoft Visual C++ .NET 69462-006-3405781-18776, Microsoft Development Environment 2003 Version 7.1.3088, Microsoft .NET Framework 1.1 Version 1.1.4322 SP1 Most developers...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.