bool Address::fromString(std::string const& _input, AddrType const _type) { bool status = false; AddrType iptype = _type; if (iptype == ADT_UNKN) { iptype = detectIpType(_input); } switch (iptype) { case ADT_UNKN: { status = false; break; } case ADT_IPV4: { type_ = ADT_IPV4; status = fromStringImpl(_input, 4); break; } case ADT_IPV6: { status = fromStringImpl(_input, 6); break; } } // Set type. if (status) { type_ = iptype; } return status; }
template<> Fixed16 fromString<Fixed16>(const std::string& s){ Fixed16 result; fromStringImpl(s,result); return result; }