15 const auto start = this->
url_str.find(
"://");
16 if (start == std::string::npos)
17 throw std::invalid_argument(std::string(
18 (std::string)__FILE__ +
":" + std::to_string(__LINE__) +
19 ", constructor " + __func__ +
". '://' not found in url."));
22 const auto end = this->
url_str.find_first_of(
"/", start + 3);
23 if (end == std::string::npos)
24 throw std::invalid_argument(
25 std::string((std::string)__FILE__ +
":" + std::to_string(__LINE__) +
26 ", constructor " + __func__ +
27 ". hostport delimiter '/' not found in url."));
29 const auto hostport_size = end - start - 3;
30 if (hostport_size == 0)
31 throw std::invalid_argument(std::string(
32 (std::string)__FILE__ +
":" + std::to_string(__LINE__) +
33 ", constructor " + __func__ +
". 'No hostport found in url."));