Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7236 in orxonox.OLD for branches/preferences


Ignore:
Timestamp:
Mar 21, 2006, 4:13:56 PM (19 years ago)
Author:
rennerc
Message:

converted char* in preferences to std::string

Location:
branches/preferences/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/preferences/src/lib/BuildLibs.am

    r7151 r7236  
    1616                $(LIB_PREFIX)/parser/tinyxml/libtinyxml.a \
    1717                $(LIB_PREFIX)/parser/ini_parser/libIniParser.a \
     18                $(LIB_PREFIX)/parser/preferences/libPrefsParser.a \
    1819                $(LIB_PREFIX)/shell/libORXshell.a \
    1920                $(LIB_PREFIX)/math/libORXmath.a
  • branches/preferences/src/lib/parser/preferences/ini_file_prefs_reader.cc

    r7234 r7236  
    2424 * standard constructor
    2525*/
    26 IniFilePrefsReader::IniFilePrefsReader ( const char * fileName )
     26IniFilePrefsReader::IniFilePrefsReader ( const std::string& fileName )
    2727{
    2828  IniParser iniParser;
     
    4141      prefs->setString( iniParser.getCurrentSection(), iniParser.getCurrentName(), iniParser.getCurrentValue(), true );
    4242    } while (iniParser.nextVar());
    43   } while (iniParser.nextSection()!=NULL);
     43  } while ( iniParser.nextSection() != "" );
    4444
    4545  /*iniParser.firstVar();
  • branches/preferences/src/lib/parser/preferences/ini_file_prefs_reader.h

    r7234 r7236  
    1515
    1616 public:
    17    IniFilePrefsReader(const char* fileName);
     17   IniFilePrefsReader(const std::string& fileName);
    1818   virtual ~IniFilePrefsReader();
    1919
  • branches/preferences/src/lib/util/preferences.h

    r7234 r7236  
    1616
    1717typedef struct {
    18   char* name;
     18  std::string name;
    1919  MultiType value;
    2020  bool modified;
     
    2222
    2323typedef struct {
    24   char* sectionName;
     24  std::string sectionName;
    2525  std::list<prefItem> items;
    2626} prefSection ;
     
    3636
    3737   //check if this entry exists
    38    bool exists(const char* section, const char* name);
     38   bool exists(const std::string& section, const std::string& name);
    3939
    40    void setString(const char* section, const char* name, const char* value, bool dontSetModified = false);
    41    void setInt(const char* section, const char* name, int value, bool dontSetModified = false);
    42    void setFloat(const char* section, const char* name, float value, bool dontSetModified = false);
    43    void setMultiType(const char* section, const char* name, MultiType& value, bool dontSetModified = false);
     40   void setString(const std::string& section, const std::string& name, const std::string& value, bool dontSetModified = false);
     41   void setInt(const std::string& section, const std::string& name, int value, bool dontSetModified = false);
     42   void setFloat(const std::string& section, const std::string& name, float value, bool dontSetModified = false);
     43   void setMultiType(const std::string& section, const std::string& name, MultiType& value, bool dontSetModified = false);
    4444
    45    const char* getString(const char* section, const char* name, const char* defaultValue);
    46    int getInt(const char* section, const char* name, int defaultValue);
    47    float getFloat(const char* section, const char* name, float defaultValue);
    48    MultiType getMultiType(const char* section, const char* name, const MultiType& defaultValue);
     45   const std::string getString(const std::string& section, const std::string& name, const std::string& defaultValue);
     46   int getInt(const std::string& section, const std::string& name, int defaultValue);
     47   float getFloat(const std::string& section, const std::string& name, float defaultValue);
     48   MultiType getMultiType(const std::string& section, const std::string& name, const MultiType& defaultValue);
    4949
    50    void setUserIni(const char* fileName);
     50   void setUserIni(const std::string& fileName);
    5151
    5252   bool save();
     
    6464   std::list<IniFilePrefsReader*> iniFilePrefsReaders;
    6565
    66    char* fileName;
     66   std::string& fileName;
    6767
    6868};
  • branches/preferences/src/orxonox.cc

    r7234 r7236  
    405405  CmdLinePrefsReader prefs(argc, argv);
    406406
    407   /*int i;
     407  int i;
    408408  for(i = 1; i < argc; ++i)
    409409  {
     
    418418    else if(!strcmp( "--license", argv[i])  || !strcmp("-l", argv[i]))
    419419      return PRINT(0)(ORXONOX_LICENSE_SHORT);
    420 }
    421 
    422   return startOrxonox(argc, argv, NULL, -1);*/
     420  }
     421
     422  return startOrxonox(argc, argv, NULL, -1);
    423423  return 0;
    424424}
Note: See TracChangeset for help on using the changeset viewer.