Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Mar 9, 2006, 8:47:20 PM (18 years ago)
Author:
rennerc
Message:

removed std::string& a = NULL in some headers

Location:
branches/std/src/lib/parser/ini_parser
Files:
2 edited

Legend:

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

    r7204 r7205  
    118118    // READING IN THE INI-FILE //
    119119    /////////////////////////////
    120     char lineBuffer[PARSELINELENGHT];
    121     char buffer[PARSELINELENGHT];
     120    char lineBuffer[PARSELINELENGHT+1];
     121    char buffer[PARSELINELENGHT+1];
    122122    const char* lineBegin;
    123123    char* ptr;
     
    129129      if( (ptr = strchr( lineBuffer, '\n')) != NULL)
    130130        *ptr = 0;
     131      else
     132        lineBuffer[PARSELINELENGHT] = 0;
    131133      // cut up to the beginning of the line.
    132134      while((*lineBegin == ' ' || *lineBegin == '\t') && lineBegin < lineBuffer + strlen(lineBuffer))
    133135        ++lineBegin;
     136     
     137      if ( !strcmp( lineBegin, "" ) )
     138        continue;
    134139
    135140      // check if we have a FileComment
     
    181186          --nameEnd;
    182187        nameEnd[1] = '\0';
    183 
     188       
    184189        this->addVar(lineBegin, valueBegin);
    185190        this->setEntryComment();
  • branches/std/src/lib/parser/ini_parser/ini_parser.h

    r7203 r7205  
    6767
    6868
    69     bool addVar(const std::string& entryName, const std::string& value, const std::string& sectionName = NULL);
     69    bool addVar(const std::string& entryName, const std::string& value, const std::string& sectionName = "" );
    7070    const std::string& getVar(const std::string& entryName, const std::string& sectionName, const std::string& defaultValue = "") const;
    7171    void setEntryComment(const std::string& comment, const std::string& entryName, const std::string& sectionName);
     
    9898    std::list<IniSection>::iterator getSectionIT(const std::string& sectionName);
    9999
    100     std::list<IniEntry>::const_iterator getEntryIT(const std::string& entryName, const std::string& sectionName = NULL) const;
    101     std::list<IniEntry>::iterator getEntryIT(const std::string& entryName, const std::string& sectionName = NULL);
     100    std::list<IniEntry>::const_iterator getEntryIT(const std::string& entryName, const std::string& sectionName = "") const;
     101    std::list<IniEntry>::iterator getEntryIT(const std::string& entryName, const std::string& sectionName = "");
    102102
    103103  private:
Note: See TracChangeset for help on using the changeset viewer.