Changeset 7204 in orxonox.OLD for branches/std/src/lib/parser/ini_parser
- Timestamp:
- Mar 9, 2006, 6:10:22 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/std/src/lib/parser/ini_parser/ini_parser.cc
r7203 r7204 68 68 { 69 69 // 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 84 72 this->currentSection = this->sections.end(); 85 73 this->setFileName(NULL); … … 95 83 { 96 84 this->comment = ""; 97 98 if (!fileName.empty()) 99 this->fileName = fileName; 100 else 101 this->fileName = ""; 85 this->fileName = fileName; 102 86 } 103 87 … … 118 102 if (!this->fileName.empty()) 119 103 this->deleteSections(); 104 120 105 if( fileName.empty()) 121 106 return false; … … 151 136 if ( (*lineBegin == '#' || *lineBegin == ';')) 152 137 { 153 char* newCommenLine = new char[strlen(lineBegin)+1]; 154 strcpy(newCommenLine, lineBegin); 138 string newCommenLine = lineBegin; 155 139 this->commentList.push_back(newCommenLine); 156 140 continue; … … 276 260 if (!this->sections.empty()) 277 261 this->currentEntry = (*this->currentSection).entries.begin(); 278 PRINTF(5)("Added Section %s\n", sectionName );262 PRINTF(5)("Added Section %s\n", sectionName.c_str()); 279 263 return true; 280 264 }
Note: See TracChangeset
for help on using the changeset viewer.