MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / to_string

Method to_string

libi2pd/HTTP.cpp:233–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231 }
232
233 std::string URL::to_string() {
234 std::string out = "";
235 if (schema != "") {
236 out = schema + "://";
237 if (user != "" && pass != "") {
238 out += user + ":" + pass + "@";
239 } else if (user != "") {
240 out += user + "@";
241 }
242 if (ipv6) {
243 if (port) {
244 out += "[" + host + "]:" + std::to_string(port);
245 } else {
246 out += "[" + host + "]";
247 }
248 } else {
249 if (port) {
250 out += host + ":" + std::to_string(port);
251 } else {
252 out += host;
253 }
254 }
255 }
256 out += path;
257 if (hasquery) // add query even if it was empty
258 out += "?";
259 if (query != "")
260 out += query;
261 if (frag != "")
262 out += "#" + frag;
263 return out;
264 }
265
266 bool URL::is_i2p() const
267 {

Callers 15

MapToLoopbackFunction · 0.80
ConnectMethod · 0.80
SendProxyErrorMethod · 0.80
SendRedirectMethod · 0.80
HandleRequestMethod · 0.80
SocksProxySuccessMethod · 0.80
MakeRequestMethod · 0.80
mainFunction · 0.80
mainFunction · 0.80
ShowStatusFunction · 0.80

Calls 3

to_stringFunction · 0.85
gen_rfc7231_dateFunction · 0.85
HTTPCodeToStatusFunction · 0.85

Tested by 2

mainFunction · 0.64
mainFunction · 0.64