Changeset 7236 in orxonox.OLD for branches/preferences
- Timestamp:
- Mar 21, 2006, 4:13:56 PM (19 years ago)
- Location:
- branches/preferences/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/preferences/src/lib/BuildLibs.am
r7151 r7236 16 16 $(LIB_PREFIX)/parser/tinyxml/libtinyxml.a \ 17 17 $(LIB_PREFIX)/parser/ini_parser/libIniParser.a \ 18 $(LIB_PREFIX)/parser/preferences/libPrefsParser.a \ 18 19 $(LIB_PREFIX)/shell/libORXshell.a \ 19 20 $(LIB_PREFIX)/math/libORXmath.a -
branches/preferences/src/lib/parser/preferences/ini_file_prefs_reader.cc
r7234 r7236 24 24 * standard constructor 25 25 */ 26 IniFilePrefsReader::IniFilePrefsReader ( const char *fileName )26 IniFilePrefsReader::IniFilePrefsReader ( const std::string& fileName ) 27 27 { 28 28 IniParser iniParser; … … 41 41 prefs->setString( iniParser.getCurrentSection(), iniParser.getCurrentName(), iniParser.getCurrentValue(), true ); 42 42 } while (iniParser.nextVar()); 43 } while ( iniParser.nextSection()!=NULL);43 } while ( iniParser.nextSection() != "" ); 44 44 45 45 /*iniParser.firstVar(); -
branches/preferences/src/lib/parser/preferences/ini_file_prefs_reader.h
r7234 r7236 15 15 16 16 public: 17 IniFilePrefsReader(const char*fileName);17 IniFilePrefsReader(const std::string& fileName); 18 18 virtual ~IniFilePrefsReader(); 19 19 -
branches/preferences/src/lib/util/preferences.h
r7234 r7236 16 16 17 17 typedef struct { 18 char*name;18 std::string name; 19 19 MultiType value; 20 20 bool modified; … … 22 22 23 23 typedef struct { 24 char*sectionName;24 std::string sectionName; 25 25 std::list<prefItem> items; 26 26 } prefSection ; … … 36 36 37 37 //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); 39 39 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); 44 44 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); 49 49 50 void setUserIni(const char*fileName);50 void setUserIni(const std::string& fileName); 51 51 52 52 bool save(); … … 64 64 std::list<IniFilePrefsReader*> iniFilePrefsReaders; 65 65 66 char*fileName;66 std::string& fileName; 67 67 68 68 }; -
branches/preferences/src/orxonox.cc
r7234 r7236 405 405 CmdLinePrefsReader prefs(argc, argv); 406 406 407 /*int i;407 int i; 408 408 for(i = 1; i < argc; ++i) 409 409 { … … 418 418 else if(!strcmp( "--license", argv[i]) || !strcmp("-l", argv[i])) 419 419 return PRINT(0)(ORXONOX_LICENSE_SHORT); 420 }421 422 return startOrxonox(argc, argv, NULL, -1); */420 } 421 422 return startOrxonox(argc, argv, NULL, -1); 423 423 return 0; 424 424 }
Note: See TracChangeset
for help on using the changeset viewer.