Abstract parseUrl.

This commit is contained in:
Arthur Britto
2012-12-29 14:39:41 -08:00
parent eaa1ce55ba
commit dc2d87480f
9 changed files with 75 additions and 34 deletions

View File

@@ -362,22 +362,4 @@ void HttpsClient::httpsGet(
client->httpsGet(deqSites, timeout, complete);
}
bool HttpsClient::httpsParseUrl(const std::string& strUrl, std::string& strDomain, std::string& strPath)
{
static boost::regex reUrl("(?i)\\`\\s*https://([^/]+)(/.*)\\s*\\'"); // https://DOMAINPATH
boost::smatch smMatch;
bool bMatch = boost::regex_match(strUrl, smMatch, reUrl); // Match status code.
if (bMatch)
{
strDomain = smMatch[1];
strPath = smMatch[2];
}
// std::cerr << strUrl << " : " << bMatch << " : '" << strDomain << "' : '" << strPath << "'" << std::endl;
return bMatch;
}
// vim:ts=4