@@ -79,32 +79,3 @@ uint32_t crc_update(uint32_t crc, const void * data, size_t data_len)
7979
8080 return crc & 0xffffffff ;
8181}
82-
83- /* Original code: http://stackoverflow.com/questions/2616011/easy-way-to-parse-a-url-in-c-cross-platform */
84- using namespace std ;
85-
86- // ctors, copy, equality, ...
87- // TODO: change me into something embedded friendly (this function adds ~100KB to flash)
88- void URI::parse (const string& url_s)
89- {
90- const string prot_end (" ://" );
91- string::const_iterator prot_i = search (url_s.begin (), url_s.end (),
92- prot_end.begin (), prot_end.end ());
93- protocol_.reserve (distance (url_s.begin (), prot_i));
94- transform (url_s.begin (), prot_i,
95- back_inserter (protocol_),
96- ptr_fun<int ,int >(tolower)); // protocol is icase
97- if ( prot_i == url_s.end () )
98- return ;
99- advance (prot_i, prot_end.length ());
100- string::const_iterator path_i = find (prot_i, url_s.end (), ' /' );
101- host_.reserve (distance (prot_i, path_i));
102- transform (prot_i, path_i,
103- back_inserter (host_),
104- ptr_fun<int ,int >(tolower)); // host is icase
105- string::const_iterator query_i = find (path_i, url_s.end (), ' ?' );
106- path_.assign (path_i, query_i);
107- if ( query_i != url_s.end () )
108- ++query_i;
109- query_.assign (query_i, url_s.end ());
110- }
0 commit comments