Changeset 9869 in orxonox.OLD for trunk/src/lib/parser/ini_parser
- Timestamp:
- Oct 3, 2006, 12:19:30 AM (18 years ago)
- Location:
- trunk/src/lib/parser/ini_parser
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/parser/ini_parser/Makefile.am
r8330 r9869 1 INCLUDES =-I../../util1 INCLUDES = -I../../.. 2 2 3 3 -
trunk/src/lib/parser/ini_parser/ini_parser.cc
r9406 r9869 29 29 30 30 #ifdef DEBUG_LEVEL 31 #include "../../../ defs/debug.h"31 #include "../../../lib/util/debug.h" 32 32 #else 33 33 #define PRINTF(x) printf … … 165 165 else if( (ptr = strchr( lineBegin, '=')) != NULL) 166 166 { 167 if (currentSection == NULL)167 if (currentSection == this->sections.end()) 168 168 { 169 169 PRINTF(2)("Not in a Section yet for %s\n", lineBegin); … … 470 470 { 471 471 std::list<IniEntry>::const_iterator entry = this->getEntryIT(entryName, sectionName); 472 if ( entry != NULL &&(*entry).name == entryName)472 if (/** FIXME entry != NULL && */ (*entry).name == entryName) 473 473 return (*entry).value; 474 474 PRINTF(2)("Entry '%s' in section '%s' not found.\n", entryName.c_str(), sectionName.c_str()); … … 627 627 if ((*entry).name == entryName) 628 628 break; 629 if (entry == (*section).entries.end()) 630 return NULL; 631 else 632 return entry; 629 return entry; 633 630 } 634 631 … … 650 647 if ((*entry).name == entryName) 651 648 break; 652 if (entry == (*section).entries.end()) 653 return NULL; 654 else 655 return entry; 649 return entry; 656 650 } 657 651 -
trunk/src/lib/parser/ini_parser/ini_parser.h
r8330 r9869 11 11 #define PARSELINELENGHT 512 //!< how many chars to read at once 12 12 13 #include " filesys/file.h"13 #include "lib/util/filesys/file.h" 14 14 #include <list> 15 15 … … 66 66 bool addVar(const std::string& entryName, const std::string& value, const std::string& sectionName = "" ); 67 67 const std::string& getVar(const std::string& entryName, const std::string& sectionName, const std::string& defaultValue = "") const; 68 bool IniParser::editVar(const std::string& entryName, const std::string& value, const std::string& sectionName = "", bool createMissing = true);68 bool editVar(const std::string& entryName, const std::string& value, const std::string& sectionName = "", bool createMissing = true); 69 69 void setEntryComment(const std::string& comment, const std::string& entryName, const std::string& sectionName); 70 70 const std::string& getEntryComment(const std::string& entryName, const std::string& sectionName) const;
Note: See TracChangeset
for help on using the changeset viewer.