From 816941559161cbc54d5373713cf07fb3fe40e311 Mon Sep 17 00:00:00 2001 From: Alex Borisov Date: Mon, 19 Dec 2011 04:04:57 +0200 Subject: XML config public API. read/write static proxies to/from XML. few bug fixes --- client/Config.h | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'client/Config.h') diff --git a/client/Config.h b/client/Config.h index 5254361..f7653e0 100644 --- a/client/Config.h +++ b/client/Config.h @@ -140,7 +140,7 @@ public: * @return Alphabetically sorted vector with unique state names.
* Resultant vector may be empty in case if there are no states in specified country */ - vector GetStates(std::string &country); + vector GetStates(string &country); /** * @brief Get list of cities in particular country without states
@@ -178,13 +178,20 @@ public: */ vector GetProxies(string &country, string &state, string &city); + /** + * @brief Get static proxy entry by name + * @param name static proxy name + * @return ProxyEntryStatic object on success or false otherwise + */ + ProxyEntryStatic* GetStaticProxy(string& name); + /** * @brief Get list of static proxy entries * @param line number of GUI line proxy list associated with * @return List of static proxy entries sorted by speed in descending order */ vector GetStaticProxyGuiLine(unsigned line); - + /** * @brief Get number of static proxy GUI lines * @return number of static proxy GUI lines or 0 if none @@ -245,53 +252,50 @@ protected: */ unsigned retryTimeout; }; - + + /** + * @brief array of config server entries + */ + vector servers; + /** + * @brief time between subsequent config updates + */ + unsigned updateInterval; /** * @brief create new instance (not allowed for use by other classes and functions) */ Config(); - /** * @brief parse client configuration * @param data string containing configuration parameters */ void ParseConfig(string data); - /** * @brief parse list of generic proxies * @param data string containing list of ProxyEntryGeneric records */ void ParseGenericProxies(string data); - /** * @brief parse list of static proxies * @param data string containing list of ProxyEntryStatic records */ - void ParseStaticPorxies(string data); - + void ParseStaticProxies(string data); /** * @brief parse firewall configuration * @param data string containing list of FirewallEntry records */ void ParseFirewalls(string data); - /** * @brief parse list of file to be deleted * @param data string containing path to aforementioned file */ void ParseDeleteList(string data); - /** * @brief parse list of files to be downloaded * @param data string containing path to new file and it's md5 hash */ void ParseDownloadList(string data); - /** - * @brief time between subsequent config updates - */ - unsigned updateInterval; - vector servers; private: vector genericProxy; vector staticProxy; -- cgit v1.2.3