Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5935 in orxonox.OLD for trunk/src/lib


Ignore:
Timestamp:
Dec 6, 2005, 1:38:55 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: ini-parser works again

Location:
trunk/src/lib/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/util/ini_parser.cc

    r5934 r5935  
    414414}
    415415
     416
     417/**
     418 * @returns the name of the Current selected Section
     419 */
     420const char* IniParser::getCurrentSection() const
     421{
     422 return (this->currentSection!=NULL) ?
     423   this->currentSection->name :
     424   NULL;
     425 }
     426
     427
     428/**
     429 * @returns the current entries Name, or NULL if we havn't selected a Entry
     430 */
     431const char* IniParser::getCurrentName() const
     432{
     433 if (!this->sections.empty() &&
     434     this->currentEntry != (*this->currentSection).entries.end())
     435   return (*this->currentEntry).name;
     436 else
     437   return NULL;
     438}
     439
     440/**
     441 * @returns the current entries Value, or NULL if we havn't selected a Entry
     442 */
     443const char* IniParser::getCurrentValue() const
     444{
     445  if (!this->sections.empty()
     446      && this->currentEntry != (*this->currentSection).entries.end())
     447    return (*this->currentEntry).value;
     448  else
     449    return NULL;
     450}
     451
     452
    416453/**
    417454 * @brief output the whole tree in a nice and easy way.
  • trunk/src/lib/util/ini_parser.h

    r5934 r5935  
    6363    bool nextVar();
    6464
    65     /** @returns the name of the Current selected Section */
    66     const char* getCurrentSection() const { return (this->currentSection!=NULL)?this->currentSection->name:NULL; };
    67     /** @returns the current entries Name, or NULL if we havn't selected a Entry */
    68     const char* getCurrentName() const { return (this->currentEntry!=NULL)?this->currentEntry->name:NULL; };
    69     /** @returns the current entries Value, or NULL if we havn't selected a Entry */
    70     const char* getCurrentValue() const { return (this->currentEntry!=NULL)?this->currentEntry->value:NULL; };
     65    const char* getCurrentSection() const;
     66    const char* getCurrentName() const;
     67    const char* getCurrentValue() const;
    7168
    7269    void debug() const;
Note: See TracChangeset for help on using the changeset viewer.