Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > XML or file parser?

Reply
Thread Tools

XML or file parser?

 
 
Travis
Guest
Posts: n/a
 
      11-07-2007
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.

 
Reply With Quote
 
 
 
 
owebeeone@gmail.com
Guest
Posts: n/a
 
      11-07-2007
On Nov 8, 3:08 am, Travis <(E-Mail Removed)> wrote:
> 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.

 
Reply With Quote
 
 
 
 
mczard@poczta.onet.pl
Guest
Posts: n/a
 
      12-10-2007
On 7 Lis, 17:08, Travis <(E-Mail Removed)> wrote:

> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
including one XML file in another XML file Johan XML 20 02-27-2007 04:29 PM
Problem to insert an XML-element by XSLT-converting from one XML-file into another XML-file jkflens XML 2 05-30-2006 09:41 AM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
UPnP xml file to WSDL xml file Robert S XML 1 10-14-2005 09:32 PM
tool to validate xml file against custom XML Schema file Leona XML 9 11-01-2004 09:51 AM



Advertisments