Changeset 5944 in orxonox.OLD for trunk/src/lib/parser/ini_parser
- Timestamp:
- Dec 6, 2005, 10:06:10 PM (19 years ago)
- Location:
- trunk/src/lib/parser
- Files:
-
- 3 added
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/parser/ini_parser/ini_parser.cc
r5943 r5944 24 24 #include <string.h> 25 25 26 #if HAVE_CONFIG_H 27 #include <config.h> 26 #if HAVE_CONFIG_H 27 #include <config.h> 28 28 #endif 29 29 30 30 #ifdef DEBUG 31 #include " debug.h"31 #include "../../../defs/debug.h" 32 32 #else 33 33 #define PRINTF(x) printf … … 68 68 { 69 69 IniSection section = this->sections.front(); 70 70 71 71 // in all entries of the sections 72 72 while(!section.entries.empty()) … … 107 107 108 108 /** 109 * @brief opens a file to parse 109 * @brief opens a file to parse 110 110 * @param fileName: path and name of the new file to parse 111 111 * @return true on success false otherwise; … … 217 217 { 218 218 fprintf(stream, "\n [%s]\n", (*section).name); 219 219 220 220 std::list<IniEntry>::const_iterator entry; 221 221 for (entry = (*section).entries.begin(); entry != (*section).entries.end(); entry++) … … 316 316 bool IniParser::nextVar() 317 317 { 318 if ( this->sections.empty() 318 if ( this->sections.empty() 319 319 || this->currentSection == this->sections.end() 320 320 || this->currentEntry == (*this->currentSection).entries.end()) … … 342 342 { 343 343 std::list<IniSection>::iterator section; 344 344 345 345 if (sectionName != NULL) 346 346 { … … 402 402 else 403 403 section = this->currentSection; 404 404 405 405 if (section == this->sections.end()) 406 406 { … … 414 414 return (*entry).value; 415 415 PRINTF(2)("Entry '%s' in section '%s' not found.\n", entryName, sectionName); 416 416 417 417 } 418 418 else … … 425 425 426 426 /** 427 * @returns the name of the Current selected Section 428 */ 429 const char* IniParser::getCurrentSection() const 427 * @returns the name of the Current selected Section 428 */ 429 const char* IniParser::getCurrentSection() const 430 430 { 431 431 if (!this->sections.empty() && 432 this->currentSection != this->sections.end()) 432 this->currentSection != this->sections.end()) 433 433 return this->currentSection->name; 434 434 else … … 437 437 438 438 439 /** 440 * @returns the current entries Name, or NULL if we havn't selected a Entry 439 /** 440 * @returns the current entries Name, or NULL if we havn't selected a Entry 441 441 */ 442 442 const char* IniParser::getCurrentName() const … … 451 451 452 452 /** 453 * @returns the current entries Value, or NULL if we havn't selected a Entry 454 */ 455 const char* IniParser::getCurrentValue() const 453 * @returns the current entries Value, or NULL if we havn't selected a Entry 454 */ 455 const char* IniParser::getCurrentValue() const 456 456 { 457 457 if (!this->sections.empty() && … … 460 460 return (*this->currentEntry).value; 461 461 else 462 return NULL; 462 return NULL; 463 463 } 464 464
Note: See TracChangeset
for help on using the changeset viewer.