diff options
Diffstat (limited to 'src/configmanager.h')
| -rw-r--r-- | src/configmanager.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/configmanager.h b/src/configmanager.h new file mode 100644 index 0000000..d5ecd7d --- /dev/null +++ b/src/configmanager.h | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | #ifndef CONFIG_MANAGER_H | ||
| 2 | #define CONFIG_MANAGER_H | ||
| 3 | |||
| 4 | #include "config.h" | ||
| 5 | #include "singleton.h" | ||
| 6 | #include <string> | ||
| 7 | |||
| 8 | class ConfigManager : public Singleton<ConfigManager> | ||
| 9 | { | ||
| 10 | friend class Singleton<ConfigManager>; | ||
| 11 | protected: | ||
| 12 | ConfigManager(); | ||
| 13 | ~ConfigManager(); | ||
| 14 | |||
| 15 | public: | ||
| 16 | void loadConfig( const char *lpProfile="default" ); | ||
| 17 | |||
| 18 | private: | ||
| 19 | bool parseConfig( const char *lpFileName, const char *lpProfile ); | ||
| 20 | bool processProfile( class XmlNode *pBase ); | ||
| 21 | |||
| 22 | public: // Getters, these should be moved if we make this a base class... | ||
| 23 | std::string &getDefLanguage(); | ||
| 24 | std::string &getBackend(); | ||
| 25 | |||
| 26 | private: // Properties, these should be moved if we make this a base class... | ||
| 27 | std::string sDefLang; /**< The default language for all operations. */ | ||
| 28 | std::string sBackend; /**< The backend database plugin name. */ | ||
| 29 | XmlNode *pBackend; /**< The xml snippet describing the backend. */ | ||
| 30 | }; | ||
| 31 | |||
| 32 | #endif | ||
