Skip to content

Commit 594ea2f

Browse files
removing uri implementation in favor of HttpClient
1 parent 8df53a8 commit 594ea2f

File tree

2 files changed

+0
-44
lines changed

2 files changed

+0
-44
lines changed

src/decompress/utility.cpp

-29
Original file line numberDiff line numberDiff line change
@@ -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-
}

src/decompress/utility.h

-15
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,6 @@
44
/**************************************************************************************
55
INCLUDE
66
**************************************************************************************/
7-
#include <string>
8-
#include <algorithm>
9-
#include <cctype>
10-
#include <functional>
11-
#include <iostream>
12-
13-
struct URI {
14-
public:
15-
URI(const std::string& url_s) {
16-
this->parse(url_s);
17-
}
18-
std::string protocol_, host_, path_, query_;
19-
private:
20-
void parse(const std::string& url_s);
21-
};
227

238
union HeaderVersion
249
{

0 commit comments

Comments
 (0)