bool IPAddress::tryParse(const std::string& addr, IPAddress& result) { IPv4AddressImpl impl4(IPv4AddressImpl::parse(addr)); if (impl4 != IPv4AddressImpl() || trim(addr) == "0.0.0.0") { result.newIPv4(impl4.addr()); return true; } #if defined(POCO_HAVE_IPv6) IPv6AddressImpl impl6(IPv6AddressImpl::parse(addr)); if (impl6 != IPv6AddressImpl()) { result.newIPv6(impl6.addr(), impl6.scope()); return true; } #endif return false; }