6#ifndef VERIBLOCK_POP_CPP_JSON_HPP
7#define VERIBLOCK_POP_CPP_JSON_HPP
19template <
typename Value,
typename T>
20Value ToJSON(
const T& ) {
21 static_assert(
sizeof(T) == 0,
"Undefined function for this type");
39template <
typename Object>
40Object makeEmptyObject() {
41 static_assert(
sizeof(Object) == 0,
"Undefined function for this type");
49template <
typename Array>
50Array makeEmptyArray() {
51 static_assert(
sizeof(Array) == 0,
"Undefined function for this type");
58template <
typename Value>
62 static_assert(
sizeof(Value) == 0,
"Undefined function for this type");
69template <
typename Object>
70void putStringKV(Object& ,
72 const std::string& ) {
73 static_assert(
sizeof(Object) == 0,
"Undefined function for this type");
80template <
typename Object>
81void putIntKV(Object& ,
84 static_assert(
sizeof(Object) == 0,
"Undefined function for this type");
91template <
typename Object>
92void putDoubleKV(Object&
object,
const std::string& key,
double value) {
93 json::putKV(
object, key, ToJSON<Object>(value));
100template <
typename Object>
101void putNullKV(Object& ,
const std::string& ) {
102 static_assert(
sizeof(Object) == 0,
"Undefined function for this type");
109template <
typename Value>
110void arrayPushBack(Value& ,
const Value& ) {
111 static_assert(
sizeof(Value) == 0,
"Undefined function for this type");
118template <
typename Object>
119void putBoolKV(Object& ,
122 static_assert(
sizeof(Object) == 0,
"Undefined function for this type");
127template <
typename Value,
typename Iterable>
128void putArrayKV(Value&
object,
const std::string& key,
const Iterable& val) {
129 auto arr = makeEmptyArray<Value>();
130 for (
const auto& it : val) {
131 arrayPushBack(arr, ToJSON<Value>(it));
133 putKV(
object, key, arr);