Changeset 159 for trunk/src/configuration.h
- Timestamp:
- 09/26/2008 11:32:18 AM (4 years ago)
- File:
-
- 1 edited
-
trunk/src/configuration.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/configuration.h
r158 r159 22 22 #define OPENYAHTZEE_CONFIGURATION_INC 23 23 24 #include "DBwrapper.h" // used in the back-compatibility code 24 25 #include <string> 25 26 #include <fstream> … … 33 34 typedef std::list<HighscoreItem> HighscoreList; 34 35 36 static const char* DEFAULT_HIGHSCORE_SIZE = "20"; 37 35 38 class Configuration { 36 39 public: … … 41 44 void load(std::string file); 42 45 46 /** 47 * Saves the configurations (setting and highscores) to the file 48 * specified when the class was constructed 49 */ 43 50 void save(); 51 52 /** 53 * \return the value associated with the specified key, or empty 54 * string if that key is missing 55 */ 56 std::string get(std::string key); 57 /** 58 * Associates the given value with the given key. You must call 59 * save() in order to make the change permanent. 60 * \return pointer to self. 61 */ 62 Configuration *set(std::string key, std::string value); 44 63 private: 45 64 /** … … 53 72 void saveSettings(std::ofstream *file); 54 73 void saveHighscores(std::ofstream *file); 74 75 /** 76 * Loads default settings 77 */ 78 void loadDefaultSettings(); 55 79 56 80 std::map<std::string, std::string> m_settings; … … 58 82 59 83 std::string m_file; 84 85 /* The following functions and variables are used for legacy SQLite 86 * configuration file, and could be dropped. 87 */ 88 DBwrapper old_db; 89 std::string getKeyFromDb(std::string key); 90 void importSettings(); 91 void importHighscores(); 60 92 }; 61 93
Note: See TracChangeset
for help on using the changeset viewer.
