Loading...
Searching...
No Matches
url_components.cpp
Go to the documentation of this file.
#include "ada/helpers.h"
#include "ada/url_components-inl.h"
#include <iterator>
#include <string>
namespace ada {
[[nodiscard]] std::string url_components::to_string() const {
std::string answer;
auto back = std::back_insert_iterator(answer);
answer.append("{\n");
answer.append("\t\"protocol_end\":\"");
helpers::encode_json(std::to_string(protocol_end), back);
answer.append("\",\n");
answer.append("\t\"username_end\":\"");
helpers::encode_json(std::to_string(username_end), back);
answer.append("\",\n");
answer.append("\t\"host_start\":\"");
helpers::encode_json(std::to_string(host_start), back);
answer.append("\",\n");
answer.append("\t\"host_end\":\"");
helpers::encode_json(std::to_string(host_end), back);
answer.append("\",\n");
answer.append("\t\"port\":\"");
helpers::encode_json(std::to_string(port), back);
answer.append("\",\n");
answer.append("\t\"pathname_start\":\"");
helpers::encode_json(std::to_string(pathname_start), back);
answer.append("\",\n");
answer.append("\t\"search_start\":\"");
helpers::encode_json(std::to_string(search_start), back);
answer.append("\",\n");
answer.append("\t\"hash_start\":\"");
helpers::encode_json(std::to_string(hash_start), back);
answer.append("\",\n");
answer.append("\n}");
return answer;
}
} // namespace ada
helpers.h
Definitions for helper functions used within Ada.
ada
Definition ada_idna.h:13
ada::url_components::pathname_start
uint32_t pathname_start
Definition url_components.h:69
ada::url_components::hash_start
uint32_t hash_start
Definition url_components.h:75
ada::url_components::port
uint32_t port
Definition url_components.h:66
ada::url_components::to_string
std::string to_string() const
Definition url_components.cpp:9
ada::url_components::protocol_end
uint32_t protocol_end
Definition url_components.h:51
ada::url_components::search_start
uint32_t search_start
Definition url_components.h:72
ada::url_components::host_end
uint32_t host_end
Definition url_components.h:63
ada::url_components::username_end
uint32_t username_end
Definition url_components.h:57
ada::url_components::host_start
uint32_t host_start
Definition url_components.h:60
url_components-inl.h