From 1c2f53717fb5c4a901506fd4576236df257905e5 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 29 Oct 2011 01:59:11 +0300 Subject: UTF8 support. Minor Config changes --- client/Config.cpp | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'client/Config.cpp') diff --git a/client/Config.cpp b/client/Config.cpp index 16c82ac..614d95f 100644 --- a/client/Config.cpp +++ b/client/Config.cpp @@ -49,7 +49,7 @@ vector Config::GetCountries() return countries; } -vector Config::GetStates(std::string &country) +vector Config::GetStates(string &country) { vector states; for (unsigned i = 0; i < genericProxy.size(); i++) @@ -69,14 +69,13 @@ vector Config::GetStates(std::string &country) return states; } -vector Config::GetCities(std::string &country) +vector Config::GetCities(string &country) { - Logger::Trace("Getting cities in countre: %s", country.c_str()); string defState = "-"; return GetCities(country, defState); } -vector Config::GetCities(std::string &country, std::string &state) +vector Config::GetCities(string &country, string &state) { vector cities; for (unsigned i = 0; i < genericProxy.size(); i++) @@ -93,6 +92,28 @@ vector Config::GetCities(std::string &country, std::string &state) return cities; } +vector Config::GetProxies(string &country, string &city) +{ + string defState = "-"; + return GetProxies(country, defState, city); +} + +vector Config::GetProxies(string &country, string &state, string &city) +{ + vector proxies; + for (unsigned i = 0; i < genericProxy.size(); i++) + { + if ((genericProxy[i].state == state) && + (genericProxy[i].country == country) && + (genericProxy[i].city == city)) + { + proxies.push_back(genericProxy[i].host); + } + } + sort(proxies.begin(), proxies.end()); + return proxies; +} + int Config::ReadGenericProxy() { Logger::Info("Parsing generic proxy list\n"); -- cgit v1.2.3