Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9880 in orxonox.OLD for trunk/src/lib/parser/preferences


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

Location:
trunk/src/lib/parser/preferences
Files:
3 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
  • trunk/src/lib/parser/preferences/ini_file_prefs_reader.h

    r9869 r9880  
    88
    99#include "lib/parser/ini_parser/ini_parser.h"
    10 #include "lib/parser/preferences/preferences.h"
     10#include "preferences.h"
    1111
    1212
  • trunk/src/lib/parser/preferences/preferences.cc

    r9869 r9880  
    271271      if ( it2->modified )
    272272      {
    273         iniParser.editVar(it2->name, it2->value.getString(), it->sectionName);
     273        iniParser.editEntry(it->sectionName, it2->name, it2->value.getString());
    274274        didChanges = true;
    275275      }
Note: See TracChangeset for help on using the changeset viewer.