17 std::stringstream ss(
s);
18 std::string skip,_lpath,_largs,luser,lpass;
19 std::getline( ss,
_proto,
':' );
20 std::getline( ss, skip,
'/' );
21 std::getline( ss, skip,
'/' );
23 if(
s.find(
'@') !=
size_t(fc::string::npos) ) {
25 std::getline( ss, user_pass,
'@' );
26 std::stringstream upss(user_pass);
27 if( user_pass.find(
':' ) !=
size_t(fc::string::npos) ) {
28 std::getline( upss, luser,
':' );
29 std::getline( upss, lpass,
':' );
30 _user = fc::move(luser);
31 _pass = fc::move(lpass);
33 _user = fc::move(user_pass);
37 std::getline( ss, host_port,
'/' );
38 auto pos = host_port.find(
':' );
39 if( pos != fc::string::npos ) {
43 FC_THROW_EXCEPTION( parse_error_exception,
"Unable to parse port field in url",(
"url",
s ) );
45 _host = host_port.substr(0,pos);
47 _host = fc::move(host_port);
49 std::getline( ss, _lpath,
'?' );
53 if (!stricmp(
_proto.c_str(),
"file"))
62 std::getline( ss, _largs );