Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 10, 2006, 3:42:31 PM (18 years ago)
Author:
bensch
Message:

new implementation of the IniParser
Now it is in Full stl-style, with iterators, and it does not have a strange internal state, that makes absolutely no sense

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/parser/preferences/ini_file_prefs_reader.cc

    r9406 r9880  
    2828  IniParser iniParser;
    2929
    30  
     30
    3131  Preferences* prefs = Preferences::getInstance();
    32  
     32
    3333  prefs->setUserIni( fileName );
    34  
     34
    3535  if ( !iniParser.readFile( fileName ) )
    3636    return;
    3737
    38   iniParser.firstSection();
    39 
    40   do
    41   {
    42     do
    43     {
    44       prefs->setString( iniParser.getCurrentSection(), iniParser.getCurrentName(), iniParser.getCurrentValue(), true );
    45     } while (iniParser.nextVar());
    46   } while ( iniParser.nextSection() != "" );
     38  for(IniParser::Section::iterator section = iniParser.begin();
     39      section != iniParser.end();
     40      ++section)
     41    for (IniParser::Entry::iterator entry = (*section).begin();
     42         entry != (*section).end();
     43         ++entry)
     44      prefs->setString( (*section).name(), (*entry).name(), (*entry).value(), true );
    4745
    4846  /*iniParser.firstVar();
     
    5351  {
    5452    prefs->setString( iniParser.getCurrentSection(), iniParser.getCurrentName(), iniParser.getCurrentValue(), true );
    55 }*/
     53  }*/
    5654}
    5755
     
    6159*/
    6260IniFilePrefsReader::~IniFilePrefsReader ()
    63 {
    64 }
     61{}
    6562
    6663
Note: See TracChangeset for help on using the changeset viewer.