Changeset 5951 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Dec 7, 2005, 1:18:38 AM (19 years ago)
- Location:
- trunk/src/lib/parser/ini_parser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/parser/ini_parser/ini_parser.cc
r5949 r5951 544 544 545 545 /** 546 * 546 * Finds the Section Iterator of the Section Called sectionName 547 * @param sectionName the Name of the Section to get the Iterator from 547 548 */ 548 549 std::list<IniParser::IniSection>::const_iterator IniParser::getSectionIT(const char* sectionName) const 549 550 { 550 std::list<IniSection>::const_iterator section ;551 std::list<IniSection>::const_iterator section = this->currentSection; 551 552 if (sectionName != NULL) 552 {553 553 for (section = this->sections.begin(); section != this->sections.end(); section++) 554 {555 554 if (!strcmp((*section).name, sectionName)) 556 {557 555 break; 558 }559 }560 }561 else562 section = this->currentSection;563 564 556 return section; 565 557 } 566 558 567 /** 568 * 559 560 /** 561 * Finds the Section Iterator of the Section Called sectionName 562 * @param sectionName the Name of the Section to get the Iterator from 563 */ 564 std::list<IniParser::IniSection>::iterator IniParser::getSectionIT(const char* sectionName) 565 { 566 std::list<IniSection>::iterator section = this->currentSection; 567 if (sectionName != NULL) 568 for (section = this->sections.begin(); section != this->sections.end(); section++) 569 if (!strcmp((*section).name, sectionName)) 570 break; 571 return section; 572 } 573 574 575 /** 576 * Finds the Entry Iterator of the Section Called sectionName and entry called EntryName 577 * @param entryName the Name of the Entry to get the Iterator from 578 * @param sectionName the Name of the Section to get the Iterator from 569 579 */ 570 580 std::list<IniParser::IniEntry>::const_iterator IniParser::getEntryIT(const char* entryName, const char* sectionName) const … … 572 582 if (entryName == NULL) 573 583 return this->currentEntry; 574 575 } 576 584 std::list<IniSection>::const_iterator section = this->getSectionIT(sectionName); 585 std::list<IniEntry>::const_iterator entry = this->currentEntry; 586 587 if (section != this->sections.end()) 588 for (entry = (*section).entries.begin(); entry != (*section).entries.end(); entry++) 589 if (!strcmp((*entry).name, entryName)) 590 break; 591 return entry; 592 } 593 594 595 /** 596 * Finds the Entry Iterator of the Section Called sectionName and entry called EntryName 597 * @param entryName the Name of the Entry to get the Iterator from 598 * @param sectionName the Name of the Section to get the Iterator from 599 */ 600 std::list<IniParser::IniEntry>::iterator IniParser::getEntryIT(const char* entryName, const char* sectionName) 601 { 602 if (entryName == NULL) 603 return this->currentEntry; 604 std::list<IniSection>::iterator section = this->getSectionIT(sectionName); 605 std::list<IniEntry>::iterator entry = this->currentEntry; 606 607 if (section != this->sections.end()) 608 for (entry = (*section).entries.begin(); entry != (*section).entries.end(); entry++) 609 if (!strcmp((*entry).name, entryName)) 610 break; 611 return entry; 612 } 577 613 578 614 -
trunk/src/lib/parser/ini_parser/ini_parser.h
r5946 r5951 95 95 96 96 std::list<IniSection>::const_iterator getSectionIT(const char* sectionName) const; 97 std::list<IniSection>::iterator getSectionIT(const char* sectionName); 98 97 99 std::list<IniEntry>::const_iterator getEntryIT(const char* entryName, const char* sectionName = NULL) const; 100 std::list<IniEntry>::iterator getEntryIT(const char* entryName, const char* sectionName = NULL); 98 101 99 102 private:
Note: See TracChangeset
for help on using the changeset viewer.