XML or file parser?

Discussion in 'C++' started by Travis, Nov 7, 2007.

  1. Travis

    Travis Guest

    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.
    Travis, Nov 7, 2007
    #1
    1. Advertising

  2. Travis

    Guest

    On Nov 8, 3:08 am, Travis <> 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.
    , Nov 7, 2007
    #2
    1. Advertising

  3. Travis

    Guest

    On 7 Lis, 17:08, Travis <> 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
    , Dec 10, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ZOCOR

    XML Parser VS HTML Parser

    ZOCOR, Oct 3, 2004, in forum: Java
    Replies:
    11
    Views:
    809
    Paul King
    Oct 5, 2004
  2. arne
    Replies:
    0
    Views:
    351
  3. Erik Wasser
    Replies:
    5
    Views:
    445
    Peter J. Holzer
    Mar 5, 2006
  4. Sean
    Replies:
    3
    Views:
    267
    robic0
    Oct 3, 2006
  5. Sean
    Replies:
    0
    Views:
    365
Loading...

Share This Page