added operator<< overloads for dynamic::Value

This commit is contained in:
MihailRis
2024-05-09 22:01:38 +03:00
parent debdec1dc2
commit 76f52037b5
4 changed files with 40 additions and 3 deletions
+17
View File
@@ -1,7 +1,24 @@
#include "dynamic.hpp"
#include "../coders/json.hpp"
using namespace dynamic;
std::ostream& operator<<(std::ostream& stream, const dynamic::Value& value) {
stream << json::stringify(value, false, " ");
return stream;
}
std::ostream& operator<<(std::ostream& stream, const dynamic::Map_sptr& value) {
stream << json::stringify(value, false, " ");
return stream;
}
std::ostream& operator<<(std::ostream& stream, const dynamic::List_sptr& value) {
stream << json::stringify(value, false, " ");
return stream;
}
std::string List::str(size_t index) const {
const auto& value = values[index];
switch (static_cast<Type>(value.index())) {