implement Url::to_string

This commit is contained in:
yggverse 2024-08-14 21:09:53 +03:00
parent 83def8fb85
commit d6be03febf
2 changed files with 15 additions and 0 deletions

View File

@ -25,4 +25,17 @@ Url::Url(
query = results[5]; query = results[5];
} }
string Url::to_string()
{
string result;
if (!scheme.empty()) result += scheme + "://";
if (!host.empty()) result += host;
if (!port.empty()) result += ":" + port;
if (!path.empty()) result += "/" + path;
if (!query.empty()) result += "?" + query;
return result;
}
Url::~Url() = default; Url::~Url() = default;

View File

@ -20,6 +20,8 @@ namespace lib
std::string subject std::string subject
); );
std::string to_string();
~Url(); ~Url();
}; };
} }