1 class kryPrefManager 2 { 3 public: 4 kryPrefManager(); 5 ~kryPrefManager(); 6 7 void Clear(); 8 9 gboolean Load(); 10 gboolean Load(char *filename); 11 gboolean Save(); 12 gboolean Save(char *filename); 13 14 // getting values 15 int GetInt(char *section_name, char *key, int def_value); 16 int GetInt(char *key, int def_value); 17 18 char *GetString(char *section_name, char *key); 19 char *GetString(char *key); 20 21 GList *GetList(char *section_name, char *key); 22 GList *GetList(char *key); 23 24 // setting values 25 void SetInt(char *section, char *key, int val); 26 void SetInt(char *key, int val); 27 28 void SetString(char *section, char *key, char *val); 29 void SetString(char *key, char *val); 30 31 void SetListAddString(char *section, char *key, char *val); 32 void SetListAddString(char *key, char *val); 33 34 void SetListAddInt(char *section, char *key, int val); 35 void SetListAddInt(char *key, int val); 36 37 void Remove(char *section_name, char *key); 38 void Remove(char *key); 39 40 void SetFilename(char *filename); 41 42 void PushSection(char *section); 43 char *GetSection(); 44 void PopSection(); 45 void SetSection(char *section); 46 47 private: 48 49 kryPrefSection *AddSection(char *section_name); 50 51 kryHash<char *, kryPrefSection *> *m_sections; 52 53 char *m_filename; 54 55 GList *m_section_stack; 56 char *m_section_current; 57 }; 58 59 60