blob: 86bd20d7cb9c4114f92fe5e7f7c1b9e775b6933e [file] [log] [blame]
Václav Kubernát1ed4aa32020-01-23 13:13:28 +01001/*
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át1e09bd62020-02-17 15:13:38 +010010#include "utils.hpp"
Václav Kubernát1ed4aa32020-01-23 13:13:28 +010011namespace std {
12std::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át1e09bd62020-02-17 15:13:38 +010022
23std::ostream& operator<<(std::ostream& s, const std::optional<std::string>& opt)
24{
25 s << (opt ? *opt : "std::nullopt");
26 return s;
27}
28
29std::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át1ed4aa32020-01-23 13:13:28 +010039}