From 2d245fcabb385347359759de8e6c40ce16e43cab Mon Sep 17 00:00:00 2001 From: Denis Loh Date: Thu, 19 Nov 2009 12:21:55 +0100 Subject: Added options for verbosity level and auto detect settings --- misc/config.h | 49 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 44 insertions(+), 5 deletions(-) (limited to 'misc/config.h') diff --git a/misc/config.h b/misc/config.h index 018213e..40ae6f7 100644 --- a/misc/config.h +++ b/misc/config.h @@ -11,21 +11,60 @@ #include #include "../common.h" +/** + * The configuration settings + * + * This holds the configurations for the server. It holds information about the + * network settings as well as some status flags. + */ class cUPnPConfig { private: static cUPnPConfig* mInstance; cString mParsedArgs; cUPnPConfig(); public: - char* mInterface; - char* mAddress; - int mPort; - int mEnable; - int mAutoSetup; + static int verbosity; ///< the verbosity of the plugin, the higher the more messages + ///< are printed. + char* mInterface; ///< the network interface, which the server is bound to + char* mAddress; ///< the IP address which is used by the server + int mPort; ///< the port which the server is listening on + int mEnable; ///< indicates, if the server is enabled or not + int mAutoSetup; ///< indicates, if the settings are automatically detected public: virtual ~cUPnPConfig(); + /** + * Get the configuration + * + * This returns the instance of the current configuration settings. + * + * @return the configuration object + */ static cUPnPConfig* get(); + /** + * Parse setup variable + * + * This parses the setup variable with the according value. The value is a + * string representation and must be converted into the according data type. + * + * @return returns + * - \bc true, if parsing was successful + * - \bc false, otherwise + * @param Name the name of the variable + * @param Value the according value of the variable + */ bool parseSetup(const char* Name, const char* Value); + /** + * Processes the commandline arguments + * + * This processes the commandline arguments which the user specified at the + * start of the plugin. + * + * @return returns + * - \bc true, if processing was successful + * - \bc false, otherwise + * @param argc the number of arguments in the list + * @param argv the arguments as a char array + */ bool processArgs(int argc, char* argv[]); }; -- cgit v1.2.3