Streamline Log with print() and out()

This commit is contained in:
Vinnie Falco
2013-06-30 12:11:42 -07:00
parent c35c52ff08
commit b52bbccd8a
25 changed files with 174 additions and 81 deletions

View File

@@ -188,6 +188,7 @@ extern std::string urlEncode (const std::string& strSrc)
// IP Port parsing
//
// <-- iPort: "" = -1
// VFALCO TODO Make this not require boost... and especially boost::asio
bool parseIpPort (const std::string& strSource, std::string& strIP, int& iPort)
{
boost::smatch smMatch;
@@ -235,10 +236,10 @@ bool parseUrl (const std::string& strUrl, std::string& strScheme, std::string& s
boost::algorithm::to_lower (strScheme);
iPort = strPort.empty () ? -1 : lexical_cast_s<int> (strPort);
// std::cerr << strUrl << " : " << bMatch << " : '" << strDomain << "' : '" << strPort << "' : " << iPort << " : '" << strPath << "'" << std::endl;
// Log::out() << strUrl << " : " << bMatch << " : '" << strDomain << "' : '" << strPort << "' : " << iPort << " : '" << strPath << "'";
}
// std::cerr << strUrl << " : " << bMatch << " : '" << strDomain << "' : '" << strPath << "'" << std::endl;
// Log::out() << strUrl << " : " << bMatch << " : '" << strDomain << "' : '" << strPath << "'";
return bMatch;
}
@@ -261,3 +262,12 @@ bool parseQuality (const std::string& strSource, uint32& uQuality)
return !!uQuality;
}
std::string addressToString (void const* address)
{
// VFALCO TODO Clean this up, use uintptr_t and only produce a 32 bit
// output on 32 bit platforms
//
return strHex (static_cast <char const*> (address) - static_cast <char const*> (0));
}