|
|
@ -5,9 +5,9 @@ |
|
|
|
#include <string> |
|
|
|
#include <string> |
|
|
|
#include <iostream> |
|
|
|
#include <iostream> |
|
|
|
#include <boost/asio.hpp> |
|
|
|
#include <boost/asio.hpp> |
|
|
|
#include <boost/lexical_cast.hpp> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef ANDROID |
|
|
|
#ifdef ANDROID |
|
|
|
|
|
|
|
#include <boost/lexical_cast.hpp> |
|
|
|
namespace std |
|
|
|
namespace std |
|
|
|
{ |
|
|
|
{ |
|
|
|
template <typename T> |
|
|
|
template <typename T> |
|
|
@ -22,18 +22,6 @@ namespace i2p |
|
|
|
{ |
|
|
|
{ |
|
|
|
namespace util |
|
|
|
namespace util |
|
|
|
{ |
|
|
|
{ |
|
|
|
/**
|
|
|
|
|
|
|
|
wrapper arround boost::lexical_cast that "never" fails |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
template <typename T> |
|
|
|
|
|
|
|
T lexical_cast(const std::string & str, const T fallback) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
return boost::lexical_cast<T>(str); |
|
|
|
|
|
|
|
} catch ( ... ) { |
|
|
|
|
|
|
|
return fallback; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace net |
|
|
|
namespace net |
|
|
|
{ |
|
|
|
{ |
|
|
|
int GetMTU (const boost::asio::ip::address& localAddress); |
|
|
|
int GetMTU (const boost::asio::ip::address& localAddress); |
|
|
|