#ifndef UTIL_H #define UTIL_H #include #include #include #include #include #ifdef ANDROID namespace std { template std::string to_string(T value) { return boost::lexical_cast(value); } } #endif namespace i2p { namespace util { /** wrapper arround boost::lexical_cast that "never" fails */ template T lexical_cast(const std::string & str, const T fallback) { try { return boost::lexical_cast(str); } catch ( ... ) { return fallback; } } namespace net { int GetMTU (const boost::asio::ip::address& localAddress); const boost::asio::ip::address GetInterfaceAddress(const std::string & ifname, bool ipv6=false); } } } #endif