MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / tryParse

Method tryParse

base/poco/Net/src/IPAddress.cpp:511–528  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

509
510
511bool IPAddress::tryParse(const std::string& addr, IPAddress& result)
512{
513 IPv4AddressImpl impl4(IPv4AddressImpl::parse(addr));
514 if (impl4 != IPv4AddressImpl() || trim(addr) == "0.0.0.0")
515 {
516 result.newIPv4(impl4.addr());
517 return true;
518 }
519#if defined(POCO_HAVE_IPv6)
520 IPv6AddressImpl impl6(IPv6AddressImpl::parse(addr));
521 if (impl6 != IPv6AddressImpl())
522 {
523 result.newIPv6(impl6.addr(), impl6.scope());
524 return true;
525 }
526#endif
527 return false;
528}
529
530
531void IPAddress::mask(const IPAddress& mask)

Callers

nothing calls this directly

Calls 8

IPv4AddressImplClass · 0.85
IPv6AddressImplClass · 0.85
parseFunction · 0.50
trimFunction · 0.50
newIPv4Method · 0.45
addrMethod · 0.45
newIPv6Method · 0.45
scopeMethod · 0.45

Tested by

no test coverage detected