From a34402b79b38624a29ed8ea4e059af817266e6b8 Mon Sep 17 00:00:00 2001 From: deva Date: Mon, 3 Sep 2007 09:11:33 +0000 Subject: Implemented the first version of the XML request. Fixed eXpat incompatability with XML_Get/SetUserData and the void* in the handler functions. --- server/src/configuration.h | 82 ++++++++++++++++++++++------------------------ 1 file changed, 40 insertions(+), 42 deletions(-) (limited to 'server/src/configuration.h') diff --git a/server/src/configuration.h b/server/src/configuration.h index 38dd233..1b851f3 100644 --- a/server/src/configuration.h +++ b/server/src/configuration.h @@ -32,57 +32,55 @@ #include "exception.h" -namespace Pentominos { +/** + * This exception is thrown by Configuration when reload fails. + */ +class ConfigurationException: public Exception { +public: + ConfigurationException(std::string reason) : + Exception(reason) {} +}; +/** + * This is the pentominos configuration class.\n + * It simply wraps the libconfig c++ interface. It can be found at + * http://www.hyperrealm.com/libconfig/libconfig.html\n + * To find out how the interface works, see + * http://www.hyperrealm.com/libconfig/libconfig_manual.html#The-C_002b_002b-API + */ +class Configuration : public libconfig::Config { +public: /** - * This exception is thrown by Configuration when reload fails. + * Constructor.\n + * @param filename The filename to be loaded. */ - class ConfigurationException: public Pentominos::Exception { - public: - ConfigurationException(std::string reason) : - Pentominos::Exception(reason) {} - }; + Configuration(std::string filename); /** - * This is the pentominos configuration class.\n - * It simply wraps the libconfig c++ interface. It can be found at - * http://www.hyperrealm.com/libconfig/libconfig.html\n - * To find out how the interface works, see - * http://www.hyperrealm.com/libconfig/libconfig_manual.html#The-C_002b_002b-API + * reload, simply reloads the configuration file attached to the configuration + * object. */ - class Configuration : public libconfig::Config { - public: - /** - * Constructor.\n - * @param filename The filename to be loaded. - */ - Configuration(std::string filename); + void reload() throw(ConfigurationException); - /** - * reload, simply reloads the configuration file attached to the configuration - * object. - */ - void reload() throw(ConfigurationException); +private: + std::string filename; +}; - private: - std::string filename; - }; +/** + * Initialize the global configuration.\n + * This function sets the Configuration global pointer, that can be reaced through + * the config variable. + * @param config The value of the Configuration pointer. + */ +void initConfig(Configuration *config); - /** - * Initialize the global configuration.\n - * This function sets the Configuration global pointer, that can be reaced through - * the Pentominos::config variable. - * @param config The value of the Configuration pointer. - */ - void initConfig(Configuration *config); +/** + * This function returns the global configuration object pointer.\n + * Use initConfig to set it.\n + * @return The pointer to the global configuration. + */ +Configuration *config() + throw(ConfigurationException); - /** - * This function returns the global configuration object pointer.\n - * Use Pentominos::initConfig to set it.\n - * @return The pointer to the global configuration. - */ - Configuration *config() - throw(ConfigurationException); -}; #endif/*__ARTEFACT_CONFIGURATION_H__*/ -- cgit v1.2.3