debug formatting for c++20
This commit is contained in:
parent
3fc5402b69
commit
bcc5e2d9e5
@ -2,6 +2,8 @@
|
|||||||
#include <rum/http/request.h>
|
#include <rum/http/request.h>
|
||||||
#if __cplusplus >= 202302L
|
#if __cplusplus >= 202302L
|
||||||
#include <format>
|
#include <format>
|
||||||
|
#else
|
||||||
|
#include <sstream>
|
||||||
#endif
|
#endif
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -19,7 +21,15 @@ Request::operator std::string() const {
|
|||||||
cookie_string += "\t\t'" + cookie.first + "': '" + cookie.second + "'\n";
|
cookie_string += "\t\t'" + cookie.first + "': '" + cookie.second + "'\n";
|
||||||
}
|
}
|
||||||
#if __cplusplus < 202302L
|
#if __cplusplus < 202302L
|
||||||
return "";
|
std::stringstream text;
|
||||||
|
text << "Request{{\n"
|
||||||
|
<< "\tmethod: " << method << "\n"
|
||||||
|
<< "\t" << (std::string)uri << "\n"
|
||||||
|
<< "\theaders: \n"
|
||||||
|
<< headers_string << "\tcookies: \n"
|
||||||
|
<< cookie_string << "\tbody: '" << body << "'\n}}";
|
||||||
|
|
||||||
|
return text.str();
|
||||||
#else
|
#else
|
||||||
return std::vformat(
|
return std::vformat(
|
||||||
"Request{{\n"
|
"Request{{\n"
|
||||||
|
@ -2,8 +2,11 @@
|
|||||||
#include <exception>
|
#include <exception>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <regex>
|
#include <regex>
|
||||||
|
#include <sstream>
|
||||||
#if __cplusplus >= 202302L
|
#if __cplusplus >= 202302L
|
||||||
#include <format>
|
#include <format>
|
||||||
|
#else
|
||||||
|
#include <sstream>
|
||||||
#endif
|
#endif
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@ -15,7 +18,18 @@ URI::operator std::string() const {
|
|||||||
query += "\t\t'" + param.first + "': '" + param.second + "'\n";
|
query += "\t\t'" + param.first + "': '" + param.second + "'\n";
|
||||||
}
|
}
|
||||||
#if __cplusplus < 202302L
|
#if __cplusplus < 202302L
|
||||||
return "";
|
std::stringstream text;
|
||||||
|
text << "URI{{"
|
||||||
|
<< "\n\tscheme: '" << scheme << "'"
|
||||||
|
<< "\n\tuser: '" << user << "'"
|
||||||
|
<< "\n\tpassword: '" << password << "'"
|
||||||
|
<< "\n\thost: '" << host << "'"
|
||||||
|
<< "\n\tport: '" << port << "'"
|
||||||
|
<< "\n\tpath: '" << path << "'"
|
||||||
|
<< "\n\tquery: \n"
|
||||||
|
<< query << "\n\tfragment: '" << fragment << "'\n}}";
|
||||||
|
|
||||||
|
return text.str();
|
||||||
#else
|
#else
|
||||||
return std::vformat(
|
return std::vformat(
|
||||||
"URI{{"
|
"URI{{"
|
||||||
|
Loading…
Reference in New Issue
Block a user