| 7 | namespace ada { |
| 8 | |
| 9 | [[nodiscard]] std::string url_components::to_string() const { |
| 10 | std::string answer; |
| 11 | auto back = std::back_insert_iterator(answer); |
| 12 | answer.append("{\n"); |
| 13 | |
| 14 | answer.append("\t\"protocol_end\":\""); |
| 15 | helpers::encode_json(std::to_string(protocol_end), back); |
| 16 | answer.append("\",\n"); |
| 17 | |
| 18 | answer.append("\t\"username_end\":\""); |
| 19 | helpers::encode_json(std::to_string(username_end), back); |
| 20 | answer.append("\",\n"); |
| 21 | |
| 22 | answer.append("\t\"host_start\":\""); |
| 23 | helpers::encode_json(std::to_string(host_start), back); |
| 24 | answer.append("\",\n"); |
| 25 | |
| 26 | answer.append("\t\"host_end\":\""); |
| 27 | helpers::encode_json(std::to_string(host_end), back); |
| 28 | answer.append("\",\n"); |
| 29 | |
| 30 | answer.append("\t\"port\":\""); |
| 31 | helpers::encode_json(std::to_string(port), back); |
| 32 | answer.append("\",\n"); |
| 33 | |
| 34 | answer.append("\t\"pathname_start\":\""); |
| 35 | helpers::encode_json(std::to_string(pathname_start), back); |
| 36 | answer.append("\",\n"); |
| 37 | |
| 38 | answer.append("\t\"search_start\":\""); |
| 39 | helpers::encode_json(std::to_string(search_start), back); |
| 40 | answer.append("\",\n"); |
| 41 | |
| 42 | answer.append("\t\"hash_start\":\""); |
| 43 | helpers::encode_json(std::to_string(hash_start), back); |
| 44 | answer.append("\",\n"); |
| 45 | |
| 46 | answer.append("\n}"); |
| 47 | return answer; |
| 48 | } |
| 49 | |
| 50 | } // namespace ada |
nothing calls this directly
no test coverage detected