Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9869 in orxonox.OLD for trunk/src/lib/parser


Ignore:
Timestamp:
Oct 3, 2006, 12:19:30 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the new_class_id branche back to the trunk.
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/new_class_id trunk -r9683:HEAD
no conflicts… puh..

Location:
trunk/src/lib/parser
Files:
10 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/parser/Makefile.am

    r7256 r9869  
    22          tinyxml \
    33          ini_parser \
    4           preferences \
    5           cmdline_parser
     4          cmdline_parser \
     5          preferences
    66
    77
  • trunk/src/lib/parser/cmdline_parser/Makefile.am

    r7256 r9869  
     1
     2INCLUDES = -I../../..
    13
    24noinst_LIBRARIES = libCmdLineParser.a
  • trunk/src/lib/parser/cmdline_parser/cmdline_parser.cc

    r9406 r9869  
    1616#include "cmdline_parser.h"
    1717
     18#include <cassert>
    1819#include "src/lib/util/substring.h"
    1920
  • trunk/src/lib/parser/cmdline_parser/cmdline_parser.h

    r8316 r9869  
    1111#include <vector>
    1212
    13 #include "src/defs/debug.h"
    14 #include "src/lib/util/multi_type.h"
     13#include "lib/util/debug.h"
     14#include "lib/util/multi_type.h"
    1515
    1616
  • trunk/src/lib/parser/ini_parser/Makefile.am

    r8330 r9869  
    1 INCLUDES=-I../../util
     1INCLUDES = -I../../..
    22
    33
  • trunk/src/lib/parser/ini_parser/ini_parser.cc

    r9406 r9869  
    2929
    3030#ifdef DEBUG_LEVEL
    31  #include "../../../defs/debug.h"
     31 #include "../../../lib/util/debug.h"
    3232#else
    3333 #define PRINTF(x) printf
     
    165165      else if( (ptr = strchr( lineBegin, '=')) != NULL)
    166166      {
    167         if (currentSection == NULL)
     167        if (currentSection == this->sections.end())
    168168        {
    169169          PRINTF(2)("Not in a Section yet for %s\n", lineBegin);
     
    470470  {
    471471    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)
    473473      return (*entry).value;
    474474    PRINTF(2)("Entry '%s' in section '%s' not found.\n", entryName.c_str(), sectionName.c_str());
     
    627627      if ((*entry).name == entryName)
    628628        break;
    629   if (entry == (*section).entries.end())
    630     return NULL;
    631   else
    632     return entry;
     629  return entry;
    633630}
    634631
     
    650647      if ((*entry).name == entryName)
    651648        break;
    652   if (entry == (*section).entries.end())
    653     return NULL;
    654   else
    655     return entry;
     649  return entry;
    656650}
    657651
  • trunk/src/lib/parser/ini_parser/ini_parser.h

    r8330 r9869  
    1111#define PARSELINELENGHT     512       //!< how many chars to read at once
    1212
    13 #include "filesys/file.h"
     13#include "lib/util/filesys/file.h"
    1414#include <list>
    1515
     
    6666    bool addVar(const std::string& entryName, const std::string& value, const std::string& sectionName = "" );
    6767    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);
    6969    void setEntryComment(const std::string& comment, const std::string& entryName, const std::string& sectionName);
    7070    const std::string& getEntryComment(const std::string& entryName, const std::string& sectionName) const;
  • trunk/src/lib/parser/preferences/Makefile.am

    r7256 r9869  
    66libPrefsParser_a_SOURCES = \
    77                cmd_line_prefs_reader.cc \
    8                 ini_file_prefs_reader.cc
     8                ini_file_prefs_reader.cc \
     9                preferences.cc
    910
    1011
    1112noinst_HEADERS = \
    1213                cmd_line_prefs_reader.h \
    13                 ini_file_prefs_reader.h
     14                ini_file_prefs_reader.h \
     15                preferences.h
  • trunk/src/lib/parser/preferences/cmd_line_prefs_reader.h

    r7256 r9869  
    77#define _CMD_LINE_PREFS_READER_H
    88
    9 #include "stdincl.h"
    109#include "debug.h"
    1110
     
    4544};
    4645
    47 #define REGISTER_ARG_FLAG(shortOption,longOption,section,key,description,value) bool _ARGVAR_##shortOption##_##longOption = CmdLinePrefsReader::registerArgument(#shortOption[0],#longOption,section,key,description,"",value) 
     46#define REGISTER_ARG_FLAG(shortOption,longOption,section,key,description,value) bool _ARGVAR_##shortOption##_##longOption = CmdLinePrefsReader::registerArgument(#shortOption[0],#longOption,section,key,description,"",value)
    4847
    49 #define REGISTER_ARG_ARG(shortOption,longOption,section,key,description,argname) bool _ARGVAR_##shortOption##_##longOption = CmdLinePrefsReader::registerArgument(#shortOption[0],#longOption,section,key,description,argname) 
     48#define REGISTER_ARG_ARG(shortOption,longOption,section,key,description,argname) bool _ARGVAR_##shortOption##_##longOption = CmdLinePrefsReader::registerArgument(#shortOption[0],#longOption,section,key,description,argname)
    5049
    5150//! A class for reading commandline arguments into Preferences
    52 class CmdLinePrefsReader 
     51class CmdLinePrefsReader
    5352{
    5453
     
    5857
    5958    bool parse(int argc, char** argv);
    60    
     59
    6160    static bool registerArgument( const char shortOption, const std::string & longOption, const std::string & section, const std::string & key, const std::string & help,  const std::string & argName = "", const std::string & value = "%arg%" );
    62    
     61
    6362    static bool asdf;
    64    
     63
    6564  private:
    6665    static bool callBack( ArgTableEntry entry, void* data, const std::string & arg, const std::vector<MultiType> & argArgs );
    67    
     66
    6867    static RegistredArgs regArgs;
    6968
  • trunk/src/lib/parser/preferences/ini_file_prefs_reader.h

    r7256 r9869  
    77#define _INI_FILE_PREFS_READER_H
    88
    9 #include "src/lib/parser/ini_parser/ini_parser.h"
    10 #include "src/lib/util/preferences.h"
     9#include "lib/parser/ini_parser/ini_parser.h"
     10#include "lib/parser/preferences/preferences.h"
    1111
    1212
Note: See TracChangeset for help on using the changeset viewer.