mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
added operator<< overloads for dynamic::Value
This commit is contained in:
parent
debdec1dc2
commit
76f52037b5
4 changed files with 40 additions and 3 deletions
|
|
@ -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())) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue