blob: 86bd20d7cb9c4114f92fe5e7f7c1b9e775b6933e [file] [log] [blame]
/*
* Copyright (C) 2020 CESNET, https://photonics.cesnet.cz/
*
* Written by Václav Kubernát <kubernat@cesnet.cz>
*
*/
#include <experimental/iterator>
#include "parser.hpp"
#include "utils.hpp"
namespace std {
std::ostream& operator<<(std::ostream& s, const Completions& completion)
{
s << std::endl << "Completions {" << std::endl << " m_completions: ";
std::transform(completion.m_completions.begin(), completion.m_completions.end(),
std::experimental::make_ostream_joiner(s, ", "),
[] (auto it) { return '"' + it + '"'; });
s << std::endl << " m_contextLength: " << completion.m_contextLength << std::endl;
s << "}" << std::endl;
return s;
}
std::ostream& operator<<(std::ostream& s, const std::optional<std::string>& opt)
{
s << (opt ? *opt : "std::nullopt");
return s;
}
std::ostream& operator<<(std::ostream& s, const DatastoreAccess::Tree& map)
{
s << std::endl
<< "{";
for (const auto& it : map) {
s << "{\"" << it.first << "\", " << leafDataToString(it.second) << "}" << std::endl;
}
s << "}" << std::endl;
return s;
}
}