9 #ifndef CPPSERIALIZATION_JSON_SERIALIZER_H
10 #define CPPSERIALIZATION_JSON_SERIALIZER_H
22 template <
class OutputStream>
27 explicit Serializer(OutputStream& stream) : Writer<OutputStream>(stream) {}
46 void Key(
const char* key);
48 void Key(
const char* key,
size_t size);
50 void Key(
const std::string& key);
52 template <std::
size_t N>
53 void Key(
const char (&key)[N]);
56 void Value(std::nullptr_t value);
58 void Value(
bool value);
60 void Value(
int value);
62 void Value(
unsigned value);
64 void Value(int64_t value);
66 void Value(uint64_t value);
68 void Value(
double value);
70 void Value(
const char* value);
72 void Value(
const char* value,
size_t size);
74 void Value(
const std::string& value);
76 template <std::
size_t N>
77 void Value(
const char (&value)[N]);
80 void Pair(
const char* key, std::nullptr_t value)
83 void Pair(
const char* key,
bool value)
86 void Pair(
const char* key,
int value)
89 void Pair(
const char* key,
unsigned value)
92 void Pair(
const char* key, int64_t value)
95 void Pair(
const char* key, uint64_t value)
98 void Pair(
const char* key,
double value)
101 void Pair(
const char* key,
const char* value)
104 void Pair(
const char* key,
const char* value,
size_t size)
107 void Pair(
const char* key,
const std::string& value)
110 template <std::
size_t N>
111 void Pair(
const char* key,
const char (&value)[N])
void Pair(const char *key, const std::string &value)
Put the string key/value pair.
void Pair(const char *key, int value)
Put the integer key/value pair.
void StartArray()
Start new array.
void Pair(const char *key, std::nullptr_t value)
Put the null key/value pair.
void Pair(const char *key, const char(&value)[N])
Put the fixed string array key/value pair.
void Pair(const char *key, const char *value)
Put the C-string key/value pair.
void Pair(const char *key, uint64_t value)
Put the 64-bit unsigned integer key/value pair.
void EndObject()
End the current object.
void Pair(const char *key, unsigned value)
Put the unsigned integer key/value pair.
Serializer & operator=(Serializer &&)=default
void Pair(const char *key, const char *value, size_t size)
Put the C-string key/value pair with a given size.
void Pair(const char *key, bool value)
Put the boolean key/value pair.
void Pair(const char *key, int64_t value)
Put the 64-bit integer key/value pair.
void StartObject()
Start new object.
Serializer & operator=(const Serializer &)=delete
void Key(const char *key)
Put the C-string key.
void EndArray()
End the current array.
void Value(std::nullptr_t value)
Put the null value.
Serializer(Serializer &&)=default
Serializer(const Serializer &)=delete
Serializer(OutputStream &stream)
void Pair(const char *key, double value)
Put the double key/value pair.
JSON C++ Library definition.
C++ Serialization project definitions.
JSON serializer inline implementation.