16 {
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, '/' );
22
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);
32 } else {
33 _user = fc::move(user_pass);
34 }
35 }
37 std::getline( ss, host_port, '/' );
38 auto pos = host_port.find( ':' );
39 if( pos != fc::string::npos ) {
40 try {
42 } catch ( ... ) {
43 FC_THROW_EXCEPTION( parse_error_exception,
"Unable to parse port field in url",(
"url",
s ) );
44 }
45 _host = host_port.substr(0,pos);
46 } else {
47 _host = fc::move(host_port);
48 }
49 std::getline( ss, _lpath, '?' );
50#ifdef WIN32
51
52
53 if (!stricmp(
_proto.c_str(),
"file"))
55 else
57#else
58
59
61#endif
62 std::getline( ss, _largs );
64 {
65
67 }
68 }
std::optional< uint16_t > _port
wraps boost::filesystem::path to provide platform independent path manipulation.
#define FC_THROW_EXCEPTION(EXCEPTION, FORMAT,...)
static const Segment ss(Segment::ss)
uint64_t to_uint64(const fc::string &)