Drop some boost deps
[novacoin.git] / src / netbase.cpp
index 4699abf..07ee7f7 100644 (file)
@@ -21,8 +21,6 @@
 typedef SSIZE_T ssize_t;
 #endif
 
-#include <boost/algorithm/string/case_conv.hpp> // for to_lower()
-#include <boost/algorithm/string/predicate.hpp> // for startswith() and endswith()
 
 using namespace std;
 
@@ -36,7 +34,7 @@ bool fNameLookup = false;
 static const unsigned char pchIPv4[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff };
 
 enum Network ParseNetwork(std::string net) {
-    boost::to_lower(net);
+    transform(net.begin(), net.end(), net.begin(), ::tolower);
     if (net == "ipv4") return NET_IPV4;
     if (net == "ipv6") return NET_IPV6;
     if (net == "tor" || net == "onion")  return NET_TOR;
@@ -128,7 +126,7 @@ bool LookupHost(const char *pszName, std::vector<CNetAddr>& vIP, unsigned int nM
     std::string strHost(pszName);
     if (strHost.empty())
         return false;
-    if (boost::algorithm::starts_with(strHost, "[") && boost::algorithm::ends_with(strHost, "]"))
+    if ((strHost.compare(0,1, "[") == 0) && (strHost.compare(strHost.length()-1,1, "]") == 0))
     {
         strHost = strHost.substr(1, strHost.size() - 2);
     }
@@ -923,11 +921,6 @@ uint64_t CNetAddr::GetHash() const
     return nRet;
 }
 
-void CNetAddr::print() const
-{
-    printf("CNetAddr(%s)\n", ToString().c_str());
-}
-
 // private extensions to enum Network, only returned by GetExtNetwork,
 // and only used in GetReachabilityFrom
 static const int NET_UNKNOWN = NET_MAX + 0;
@@ -1170,11 +1163,6 @@ std::string CService::ToString() const
     return ToStringIPPort();
 }
 
-void CService::print() const
-{
-    printf("CService(%s)\n", ToString().c_str());
-}
-
 void CService::SetPort(unsigned short portIn)
 {
     port = portIn;