Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 6, 2005, 10:06:10 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: ini-parser in own subdir now (also moved tiXml-lib to lib/parser

Location:
trunk/src/lib/parser
Files:
2 added
1 moved

Legend:

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

    r5943 r5944  
    2424#include <string.h>
    2525
    26 #if HAVE_CONFIG_H 
    27 #include <config.h> 
     26#if HAVE_CONFIG_H
     27#include <config.h>
    2828#endif
    2929
    3030#ifdef DEBUG
    31  #include "debug.h"
     31 #include "../../../defs/debug.h"
    3232#else
    3333 #define PRINTF(x) printf
     
    6868  {
    6969     IniSection section = this->sections.front();
    70    
     70
    7171    // in all entries of the sections
    7272    while(!section.entries.empty())
     
    107107
    108108/**
    109  * @brief opens a file to parse 
     109 * @brief opens a file to parse
    110110 * @param fileName: path and name of the new file to parse
    111111 * @return true on success false otherwise;
     
    217217      {
    218218        fprintf(stream, "\n [%s]\n", (*section).name);
    219        
     219
    220220        std::list<IniEntry>::const_iterator entry;
    221221        for (entry = (*section).entries.begin(); entry != (*section).entries.end(); entry++)
     
    316316bool IniParser::nextVar()
    317317{
    318   if ( this->sections.empty() 
     318  if ( this->sections.empty()
    319319       || this->currentSection == this->sections.end()
    320320       || this->currentEntry == (*this->currentSection).entries.end())
     
    342342{
    343343  std::list<IniSection>::iterator section;
    344  
     344
    345345  if (sectionName != NULL)
    346346  {
     
    402402    else
    403403      section = this->currentSection;
    404    
     404
    405405   if (section == this->sections.end())
    406406     {
     
    414414        return (*entry).value;
    415415    PRINTF(2)("Entry '%s' in section '%s' not found.\n", entryName, sectionName);
    416    
     416
    417417  }
    418418  else
     
    425425
    426426/**
    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 */
     429const char* IniParser::getCurrentSection() const
    430430{
    431431  if (!this->sections.empty() &&
    432       this->currentSection != this->sections.end()) 
     432      this->currentSection != this->sections.end())
    433433    return this->currentSection->name;
    434434  else
     
    437437
    438438
    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
    441441 */
    442442const char* IniParser::getCurrentName() const
     
    451451
    452452/**
    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 */
     455const char* IniParser::getCurrentValue() const
    456456{
    457457  if (!this->sections.empty() &&
     
    460460    return (*this->currentEntry).value;
    461461  else
    462     return NULL; 
     462    return NULL;
    463463}
    464464
Note: See TracChangeset for help on using the changeset viewer.