Václav Kubernát | 1ed4aa3 | 2020-01-23 13:13:28 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2020 CESNET, https://photonics.cesnet.cz/ |
| 3 | * |
| 4 | * Written by Václav Kubernát <kubernat@cesnet.cz> |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #include <experimental/iterator> |
| 9 | #include "parser.hpp" |
Václav Kubernát | 1e09bd6 | 2020-02-17 15:13:38 +0100 | [diff] [blame^] | 10 | #include "utils.hpp" |
Václav Kubernát | 1ed4aa3 | 2020-01-23 13:13:28 +0100 | [diff] [blame] | 11 | namespace std { |
| 12 | std::ostream& operator<<(std::ostream& s, const Completions& completion) |
| 13 | { |
| 14 | s << std::endl << "Completions {" << std::endl << " m_completions: "; |
| 15 | std::transform(completion.m_completions.begin(), completion.m_completions.end(), |
| 16 | std::experimental::make_ostream_joiner(s, ", "), |
| 17 | [] (auto it) { return '"' + it + '"'; }); |
| 18 | s << std::endl << " m_contextLength: " << completion.m_contextLength << std::endl; |
| 19 | s << "}" << std::endl; |
| 20 | return s; |
| 21 | } |
Václav Kubernát | 1e09bd6 | 2020-02-17 15:13:38 +0100 | [diff] [blame^] | 22 | |
| 23 | std::ostream& operator<<(std::ostream& s, const std::optional<std::string>& opt) |
| 24 | { |
| 25 | s << (opt ? *opt : "std::nullopt"); |
| 26 | return s; |
| 27 | } |
| 28 | |
| 29 | std::ostream& operator<<(std::ostream& s, const DatastoreAccess::Tree& map) |
| 30 | { |
| 31 | s << std::endl |
| 32 | << "{"; |
| 33 | for (const auto& it : map) { |
| 34 | s << "{\"" << it.first << "\", " << leafDataToString(it.second) << "}" << std::endl; |
| 35 | } |
| 36 | s << "}" << std::endl; |
| 37 | return s; |
| 38 | } |
Václav Kubernát | 1ed4aa3 | 2020-01-23 13:13:28 +0100 | [diff] [blame] | 39 | } |