473,404 Members | 2,187 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,404 software developers and data experts.

XML or file parser?

I'm about 2 years out of school. The C++ development I have been doing
has not required reading in from a config file. I haven't done file
parsing since college.

So I'm curious, hasn't there been some developments in this area in
the last few years? I feel like XML would be useful for this. Ideally
I want to characterize some strings that would otherwise be in a
struct into its own, esily editable file. Does XML (or something else
for that matter) provide an easy C++ class, etc. mechanism for
extracting the data?

I guess basically I'm asking for the full gammit of intro knowledge or
should I use a space delimited .txt file and bust out my old ifstream
knowledge. :)

Thanks for all your help, this group is invaluable.

Nov 7 '07 #1
2 1540
On Nov 8, 3:08 am, Travis <travis.bow...@gmail.comwrote:
I'm about 2 years out of school. The C++ development I have been doing
has not required reading in from a config file. I haven't done file
parsing since college.
....

The Austria C++ "alpha" contains a config system that includes
different types of data sources. The data source default is an XML
file.
>From the test case:
.... this creates a "preference manager"
Ptr< PreferenceManager<* l_pm = new PreferenceManager<>();

.... this defines a "preference".
Preference< bool l_pref1( "pref1", false, "/FooProgram", l_pm );

.... there is a notion of hierarchy ... e.g. "/FooProgram" is the area
of a preference. You can set a preference in a config file that will
set all the preferences of a particular name or set one specifically
for an area. For example, the preference system is used to manage the
logging levels for the Austria logging system and so you can turn on
logging for all the subsystems or just one by using different path
names.

Nov 7 '07 #2
On 7 Lis, 17:08, Travis <travis.bow...@gmail.comwrote:
I'm about 2 years out of school. The C++ development I have been doing
has not required reading in from a config file. I haven't done file
parsing since college.

So I'm curious, hasn't there been some developments in this area in
the last few years? I feel likeXMLwould be useful for this. Ideally
I want to characterize some strings that would otherwise be in a
struct into its own, esily editable file. DoesXML(or something else
for that matter) provide an easy C++ class, etc. mechanism for
extracting the data?

I guess basically I'm asking for the full gammit of intro knowledge or
should I use a space delimited .txt file and bust out my old ifstream
knowledge. :)
Hi!
You have a problem that affects many programmers - there is much
talk about XML, but it is not easily editable nor is it compatible
with C++ data types.
I recommend you trying data languages, that were designed especially
to solve that problem, for example:
http://www.yaml.org
http://harpoon.sourceforge.net

Dec 10 '07 #3

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

Similar topics

11
by: Dale | last post by:
How to recognize whether file has XML format or not? Here is the code segment: XmlDocument* pDomDocument = new XmlDocument(); try { pDomDocument->Load(strFileName ) ; } catch(Exception* e) {
17
by: News | last post by:
Hi everyone, My goal is to pull command switches/options from a file and then assign the values to select variables which would eventually be included in a class object. The data file looks...
4
by: News | last post by:
Hi Everyone, The attached code creates client connections to websphere queue managers and then processes an inquiry against them. The program functions when it gets options from the command...
8
by: Andrew Robert | last post by:
Hi Everyone. I tried the following to get input into optionparser from either a file or command line. The code below detects the passed file argument and prints the file contents but the...
7
by: christian.eickhoff | last post by:
Hi Everyone, I am currently implementing an XercesDOMParser to parse an XML file and to validate this file against its XSD Schema file which are both located on my local HD drive. For this...
3
by: Carroll, Barry | last post by:
Greetings: Please forgive me if this is the wrong place for this post. I couldn't find a more acceptable forum. If there is one, please point me in the right direction. I am part of a small...
2
by: sherihan2007 | last post by:
Hi while am running perl script which parses an XML file in AIX following error is getting:(i have given use XML::parser in the script) Can't load...
3
by: jinendrashankar | last post by:
i am getting following error in my code help me to slove this issue $ gcc -Wall -g -I/usr/include/libxml2/libxml -c create_xml.c In file included from create_xml.c:2:...
1
by: reddyth | last post by:
Dear All, I wanted to parse an XML file and print the element's content. I have the following code for the same. I have printed the ourput too. The problem is it is printing unwanted spaces and...
5
by: Luis Zarrabeitia | last post by:
I need to parse a file, text file. The format is something like that: TYPE1 metadata data line 1 data line 2 .... data line N TYPE2 metadata data line 1 ....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.