Lines Matching refs:spec
42 parse_connection_spec_without_prefix (std::string spec, struct addrinfo *hint)
50 - spec[0] is '[', or
51 - the number of ':' on spec is greater than 1. */
54 && (spec[0] == '['
55 || std::count (spec.begin (),
56 spec.end (), ':') > 1)));
60 if (spec[0] == '[')
64 size_t close_bracket_pos = spec.find_first_of (']');
68 spec.c_str ());
72 const char c = spec[close_bracket_pos + 1];
78 spec.c_str ());
81 spec.erase (0, 1);
82 spec.erase (close_bracket_pos - 1, 1);
84 else if (spec.find_first_of (']') != std::string::npos)
86 spec.c_str ());
90 last_colon_pos = spec.find_last_of (':');
99 ret.port_str = spec.substr (last_colon_pos + 1);
102 host_len = spec.size ();
104 ret.host_str = spec.substr (0, host_len);
116 parse_connection_spec (const char *spec, struct addrinfo *hint)
142 if (startswith (spec, prefix.prefix))
144 spec += strlen (prefix.prefix);
152 return parse_connection_spec_without_prefix (spec, hint);