Skip to content

Commit 923bdf5

Browse files
author
Sebastiano Merlino
committed
Removed SWIG artifacts that are no more useful
1 parent de61c3a commit 923bdf5

File tree

4 files changed

+0
-223
lines changed

4 files changed

+0
-223
lines changed

src/http_request.cpp

Lines changed: 0 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -61,136 +61,28 @@ bool http_request::check_digest_auth(
6161
return true;
6262
}
6363

64-
const std::vector<std::pair<std::string, std::string> > http_request::get_headers() const
65-
{
66-
std::vector<std::pair<std::string, std::string> > to_ret;
67-
std::map<std::string, std::string, header_comparator>::const_iterator it;
68-
for(it = headers.begin(); it != headers.end(); ++it)
69-
#ifdef USE_CPP_ZEROX
70-
to_ret.push_back(std::make_pair((*it).first,(*it).second));
71-
#else
72-
to_ret.push_back(std::make_pair<std::string, std::string>((*it).first,(*it).second));
73-
#endif
74-
return to_ret;
75-
}
76-
size_t http_request::get_headers(std::vector<std::pair<std::string, std::string> >& result) const
77-
{
78-
std::map<std::string, std::string, header_comparator>::const_iterator it;
79-
for(it = headers.begin(); it != headers.end(); ++it)
80-
#ifdef USE_CPP_ZEROX
81-
result.push_back(std::make_pair((*it).first,(*it).second));
82-
#else
83-
result.push_back(std::make_pair<std::string, std::string>((*it).first,(*it).second));
84-
#endif
85-
return result.size();
86-
}
87-
88-
#ifndef SWIG
8964
size_t http_request::get_headers(std::map<std::string, std::string, header_comparator>& result) const
9065
{
9166
result = this->headers;
9267
return result.size();
9368
}
94-
#endif
95-
96-
const std::vector<std::pair<std::string, std::string> > http_request::get_footers() const
97-
{
98-
std::vector<std::pair<std::string, std::string> > to_ret;
99-
std::map<std::string, std::string, header_comparator>::const_iterator it;
100-
for(it = footers.begin(); it != footers.end(); ++it)
101-
#ifdef USE_CPP_ZEROX
102-
to_ret.push_back(std::make_pair((*it).first,(*it).second));
103-
#else
104-
to_ret.push_back(std::make_pair<std::string, std::string>((*it).first,(*it).second));
105-
#endif
106-
return to_ret;
107-
}
108-
size_t http_request::get_footers(std::vector<std::pair<std::string, std::string> >& result) const
109-
{
110-
std::map<std::string, std::string, header_comparator>::const_iterator it;
111-
for(it = footers.begin(); it != footers.end(); ++it)
112-
#ifdef USE_CPP_ZEROX
113-
result.push_back(std::make_pair((*it).first,(*it).second));
114-
#else
115-
result.push_back(std::make_pair<std::string, std::string>((*it).first,(*it).second));
116-
#endif
117-
return result.size();
118-
}
11969

120-
#ifndef SWIG
12170
size_t http_request::get_footers(std::map<std::string, std::string, header_comparator>& result) const
12271
{
12372
result = this->footers;
12473
return result.size();
12574
}
126-
#endif
127-
128-
const std::vector<std::pair<std::string, std::string> > http_request::get_cookies() const
129-
{
130-
std::vector<std::pair<std::string, std::string> > to_ret;
131-
std::map<std::string, std::string, header_comparator>::const_iterator it;
132-
for(it = cookies.begin(); it != cookies.end(); ++it)
133-
#ifdef USE_CPP_ZEROX
134-
to_ret.push_back(std::make_pair((*it).first,(*it).second));
135-
#else
136-
to_ret.push_back(std::make_pair<std::string, std::string>((*it).first,(*it).second));
137-
#endif
138-
return to_ret;
139-
}
140-
141-
size_t http_request::get_cookies(std::vector<std::pair<std::string, std::string> >& result) const
142-
{
143-
std::map<std::string, std::string, header_comparator>::const_iterator it;
144-
for(it = cookies.begin(); it != cookies.end(); ++it)
145-
#ifdef USE_CPP_ZEROX
146-
result.push_back(std::make_pair((*it).first,(*it).second));
147-
#else
148-
result.push_back(std::make_pair<std::string, std::string>((*it).first,(*it).second));
149-
#endif
150-
return result.size();
151-
}
15275

153-
#ifndef SWIG
15476
size_t http_request::get_cookies(std::map<std::string, std::string, header_comparator>& result) const
15577
{
15678
result = this->cookies;
15779
return result.size();
15880
}
159-
#endif
160-
161-
const std::vector<std::pair<std::string, std::string> > http_request::get_args() const
162-
{
163-
std::vector<std::pair<std::string, std::string> > to_ret;
164-
std::map<std::string, std::string, arg_comparator>::const_iterator it;
165-
for(it = args.begin(); it != args.end(); ++it)
166-
#ifdef USE_CPP_ZEROX
167-
to_ret.push_back(std::make_pair((*it).first,(*it).second));
168-
#else
169-
to_ret.push_back(std::make_pair<std::string, std::string>((*it).first,(*it).second));
170-
#endif
171-
return to_ret;
172-
}
173-
174-
size_t http_request::get_args(std::vector<std::pair<std::string, std::string> >& result) const
175-
{
176-
std::map<std::string, std::string, header_comparator>::const_iterator it;
177-
for(it = args.begin(); it != args.end(); ++it)
178-
#ifdef USE_CPP_ZEROX
179-
result.push_back(std::make_pair((*it).first,(*it).second));
180-
#else
181-
result.push_back(std::make_pair<std::string, std::string>((*it).first,(*it).second));
182-
#endif
183-
return result.size();
184-
}
18581

186-
#ifndef SWIG
18782
size_t http_request::get_args(std::map<std::string, std::string, arg_comparator>& result) const
18883
{
18984
result = this->args;
19085
return result.size();
19186
}
192-
#endif
193-
194-
19587

19688
};

src/http_response.cpp

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -37,63 +37,18 @@ http_response::~http_response()
3737
webserver::unlock_cache_entry(ce);
3838
}
3939

40-
const std::vector<std::pair<std::string, std::string> > http_response::get_headers()
41-
{
42-
std::vector<std::pair<std::string, std::string> > to_ret;
43-
std::map<std::string, std::string, header_comparator>::const_iterator it;
44-
for(it = headers.begin(); it != headers.end(); ++it)
45-
to_ret.push_back(*it);
46-
return to_ret;
47-
}
48-
size_t http_response::get_headers(std::vector<std::pair<std::string, std::string> >& result)
49-
{
50-
std::map<std::string, std::string, header_comparator>::const_iterator it;
51-
for(it = headers.begin(); it != headers.end(); ++it)
52-
result.push_back(*it);
53-
return result.size();
54-
}
5540
size_t http_response::get_headers(std::map<std::string, std::string, header_comparator>& result)
5641
{
5742
result = this->headers;
5843
return result.size();
5944
}
6045

61-
const std::vector<std::pair<std::string, std::string> > http_response::get_footers()
62-
{
63-
std::vector<std::pair<std::string, std::string> > to_ret;
64-
std::map<std::string, std::string, header_comparator>::const_iterator it;
65-
for(it = footers.begin(); it != footers.end(); ++it)
66-
to_ret.push_back(*it);
67-
return to_ret;
68-
}
69-
size_t http_response::get_footers(std::vector<std::pair<std::string, std::string> >& result)
70-
{
71-
std::map<std::string, std::string, arg_comparator>::const_iterator it;
72-
for(it = footers.begin(); it != footers.end(); ++it)
73-
result.push_back(*it);
74-
return result.size();
75-
}
7646
size_t http_response::get_footers(std::map<std::string, std::string, header_comparator>& result)
7747
{
7848
result = this->footers;
7949
return result.size();
8050
}
8151

82-
const std::vector<std::pair<std::string, std::string> > http_response::get_cookies()
83-
{
84-
std::vector<std::pair<std::string, std::string> > to_ret;
85-
std::map<std::string, std::string, header_comparator>::const_iterator it;
86-
for(it = cookies.begin(); it != cookies.end(); ++it)
87-
to_ret.push_back(*it);
88-
return to_ret;
89-
}
90-
size_t http_response::get_cookies(std::vector<std::pair<std::string, std::string> >& result)
91-
{
92-
std::map<std::string, std::string, header_comparator>::const_iterator it;
93-
for(it = cookies.begin(); it != cookies.end(); ++it)
94-
result.push_back(*it);
95-
return result.size();
96-
}
9752
size_t http_response::get_cookies(std::map<std::string, std::string, header_comparator>& result)
9853
{
9954
result = this->cookies;

src/httpserver/http_request.hpp

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -188,82 +188,30 @@ class http_request
188188
{
189189
result = this->method;
190190
}
191-
/**
192-
* Method used to get all headers passed with the request.
193-
* @return a vector<pair<string,string> > containing all headers.
194-
**/
195-
const std::vector<std::pair<std::string, std::string> > get_headers() const;
196-
/**
197-
* Method used to get all headers passed with the request.
198-
* @param result a vector<pair<string, string> > that will be filled with all headers
199-
* @result the size of the vector
200-
**/
201-
size_t get_headers(std::vector<std::pair<std::string, std::string> >& result) const;
202-
#ifndef SWIG
203191
/**
204192
* Method used to get all headers passed with the request.
205193
* @param result a map<string, string> > that will be filled with all headers
206194
* @result the size of the map
207195
**/
208196
size_t get_headers(std::map<std::string, std::string, header_comparator>& result) const;
209-
#endif
210-
/**
211-
* Method used to get all footers passed with the request.
212-
* @return a vector<pair<string,string> > containing all footers.
213-
**/
214-
const std::vector<std::pair<std::string, std::string> > get_footers() const;
215-
/**
216-
* Method used to get all footers passed with the request.
217-
* @param result a vector<pair<string, string> > that will be filled with all footers
218-
* @result the size of the vector
219-
**/
220-
size_t get_footers(std::vector<std::pair<std::string, std::string> >& result) const;
221-
#ifndef SWIG
222197
/**
223198
* Method used to get all footers passed with the request.
224199
* @param result a map<string, string> > that will be filled with all footers
225200
* @result the size of the map
226201
**/
227202
size_t get_footers(std::map<std::string, std::string, header_comparator>& result) const;
228-
#endif
229-
/**
230-
* Method used to get all cookies passed with the request.
231-
* @return a vector<pair<string, string> > containing all cookies.
232-
**/
233-
const std::vector<std::pair<std::string, std::string> > get_cookies() const;
234-
/**
235-
* Method used to get all cookies passed with the request.
236-
* @param result a vector<pair<string, string> > that will be filled with all cookies
237-
* @result the size of the vector
238-
**/
239-
size_t get_cookies(std::vector<std::pair<std::string, std::string> >& result) const;
240-
#ifndef SWIG
241203
/**
242204
* Method used to get all cookies passed with the request.
243205
* @param result a map<string, string> > that will be filled with all cookies
244206
* @result the size of the map
245207
**/
246208
size_t get_cookies(std::map<std::string, std::string, header_comparator>& result) const;
247-
#endif
248-
/**
249-
* Method used to get all parameters passed with the request. Usually parameters are passed with DELETE or GET methods.
250-
* @return a map<string,string> containing all parameters.
251-
**/
252-
const std::vector<std::pair<std::string, std::string> > get_args() const;
253-
/**
254-
* Method used to get all args passed with the request.
255-
* @param result a vector<pair<string, string> > that will be filled with all args
256-
* @result the size of the vector
257-
**/
258-
size_t get_args(std::vector<std::pair<std::string, std::string> >& result) const;
259-
#ifndef SWIG
260209
/**
261210
* Method used to get all args passed with the request.
262211
* @param result a map<string, string> > that will be filled with all args
263212
* @result the size of the map
264213
**/
265214
size_t get_args(std::map<std::string, std::string, arg_comparator>& result) const;
266-
#endif
267215
/**
268216
* Method used to get a specific header passed with the request.
269217
* @param key the specific header to get the value from

src/httpserver/http_response.hpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -254,37 +254,19 @@ class http_response
254254
* Method used to get all headers passed with the request.
255255
* @return a map<string,string> containing all headers.
256256
**/
257-
const std::vector<std::pair<std::string, std::string> > get_headers();
258-
size_t get_headers(
259-
std::vector<std::pair<std::string, std::string> >& result
260-
);
261-
#ifndef SWIG
262257
size_t get_headers(
263258
std::map<std::string, std::string, header_comparator>& result
264259
);
265-
#endif
266260
/**
267261
* Method used to get all footers passed with the request.
268262
* @return a map<string,string> containing all footers.
269263
**/
270-
const std::vector<std::pair<std::string, std::string> > get_footers();
271-
size_t get_footers(
272-
std::vector<std::pair<std::string, std::string> >& result
273-
);
274-
#ifndef SWIG
275264
size_t get_footers(
276265
std::map<std::string, std::string, header_comparator>& result
277266
);
278-
#endif
279-
const std::vector<std::pair<std::string, std::string> > get_cookies();
280-
size_t get_cookies(
281-
std::vector<std::pair<std::string, std::string> >& result
282-
);
283-
#ifndef SWIG
284267
size_t get_cookies(
285268
std::map<std::string, std::string, header_comparator>& result
286269
);
287-
#endif
288270
/**
289271
* Method used to set all headers of the response.
290272
* @param headers The headers key-value map to set for the response.

0 commit comments

Comments
 (0)