Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7204 in orxonox.OLD for branches/std/src/lib/parser


Ignore:
Timestamp:
Mar 9, 2006, 6:10:22 PM (18 years ago)
Author:
bensch
Message:

small bug… more to come :/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/std/src/lib/parser/ini_parser/ini_parser.cc

    r7203 r7204  
    6868{
    6969  // in all sections
    70   while(!this->sections.empty())
    71   {
    72     IniSection section = this->sections.front();
    73 
    74     // in all entries of the sections
    75     while(!section.entries.empty())
    76     {
    77       // delete all strings of entries.
    78       IniEntry entry = section.entries.front();
    79       section.entries.pop_front();
    80     }
    81     // delete all Sections
    82     this->sections.pop_front();
    83   }
     70  this->sections.clear();
     71
    8472  this->currentSection = this->sections.end();
    8573  this->setFileName(NULL);
     
    9583{
    9684  this->comment = "";
    97 
    98   if (!fileName.empty())
    99     this->fileName = fileName;
    100   else
    101     this->fileName = "";
     85  this->fileName = fileName;
    10286}
    10387
     
    118102  if (!this->fileName.empty())
    119103    this->deleteSections();
     104
    120105  if( fileName.empty())
    121106    return false;
     
    151136      if ( (*lineBegin == '#' || *lineBegin == ';'))
    152137      {
    153         char* newCommenLine = new char[strlen(lineBegin)+1];
    154         strcpy(newCommenLine, lineBegin);
     138        string newCommenLine = lineBegin;
    155139        this->commentList.push_back(newCommenLine);
    156140        continue;
     
    276260  if (!this->sections.empty())
    277261    this->currentEntry = (*this->currentSection).entries.begin();
    278   PRINTF(5)("Added Section %s\n", sectionName);
     262  PRINTF(5)("Added Section %s\n", sectionName.c_str());
    279263  return true;
    280264}
Note: See TracChangeset for help on using the changeset viewer.