|
Zserio C++17 runtime library 1.3.0
Built for Zserio 2.20.0
|
#include <JsonWriter.h>


Public Types | |
| enum class | EnumerableFormat { NUMBER , STRING } |
Public Types inherited from zserio::AllocatorHolder< ALLOC, EMPTY > | |
| using | allocator_type = ALLOC |
Static Public Attributes | |
| static constexpr const char * | DEFAULT_ITEM_SEPARATOR = ", " |
| static constexpr const char * | DEFAULT_ITEM_SEPARATOR_WITH_INDENT = "," |
| static constexpr const char * | DEFAULT_KEY_SEPARATOR = ": " |
| static constexpr EnumerableFormat | DEFAULT_ENUMERABLE_FORMAT = EnumerableFormat::STRING |
Additional Inherited Members | |
Protected Member Functions inherited from zserio::AllocatorHolder< ALLOC, EMPTY > | |
| void | set_allocator (const allocator_type &allocator) |
| void | set_allocator (allocator_type &&allocator) |
| allocator_type & | get_allocator_ref () |
| const allocator_type & | get_allocator_ref () const |
Walker observer which dumps zserio objects to JSON format.
Definition at line 22 of file JsonWriter.h.
Configuration for writing of enumerable types.
Definition at line 45 of file JsonWriter.h.
|
explicit |
Constructor.
| out | Stream to use for writing. |
| allocator | Allocator to use. |
Definition at line 193 of file JsonWriter.h.
| zserio::BasicJsonWriter< ALLOC >::BasicJsonWriter | ( | std::ostream & | out, |
| uint8_t | indent, | ||
| const ALLOC & | allocator = ALLOC() |
||
| ) |
Constructor.
| out | Stream to use for writing. |
| indent | Indent as a number of ' ' to be used for indentation. |
| allocator | Allocator to use. |
Definition at line 198 of file JsonWriter.h.
| zserio::BasicJsonWriter< ALLOC >::BasicJsonWriter | ( | std::ostream & | out, |
| const BasicString< RebindAlloc< ALLOC, char > > & | indent, | ||
| const ALLOC & | allocator = ALLOC() |
||
| ) |
Constructor.
| out | Stream to use for writing. |
| indent | Indent as a string to be used for indentation. |
| allocator | Allocator to use. |
Definition at line 203 of file JsonWriter.h.
|
overridedefault |
Method generated by default.
|
delete |
Copying and moving is disallowed!
|
delete |
Copying and moving is disallowed!
|
overridevirtual |
Called at the beginning of an array.
Note that for unset arrays (i.e. non-present optionals) the visitValue method with nullptr is called instead!
| array | Reflectable zserio array. |
| fieldInfo | Array field info. |
Implements zserio::IBasicWalkObserver< ALLOC >.
Definition at line 251 of file JsonWriter.h.
|
overridevirtual |
Called at the beginning of an compound field object.
Note that for unset compounds (i.e. non-present optionals) the visitValue method with nullptr is called instead!
| compound | Reflectable compound zserio object. |
| fieldInfo | Compound field info. |
| elementIndex | Element index in array or WALKER_NOT_ELEMENT if the compound is not in array. |
Implements zserio::IBasicWalkObserver< ALLOC >.
Definition at line 270 of file JsonWriter.h.
|
overridevirtual |
Called for the root compound zserio object which is to be walked-through.
| compound | Reflectable root compound zserio object. |
Implements zserio::IBasicWalkObserver< ALLOC >.
Definition at line 238 of file JsonWriter.h.
|
overridevirtual |
Called at the end of an array.
| array | Reflectable zserio array. |
| fieldInfo | Array field info. |
Implements zserio::IBasicWalkObserver< ALLOC >.
Definition at line 262 of file JsonWriter.h.
|
overridevirtual |
Called at the end of just walked compound object.
| compound | Reflectable compound zserio object. |
| fieldInfo | Compound field info. |
| elementIndex | Element index in array or WALKER_NOT_ELEMENT if the compound is not in array. |
Implements zserio::IBasicWalkObserver< ALLOC >.
Definition at line 284 of file JsonWriter.h.
|
overridevirtual |
Called at the end of just walked root compound zserio object.
| compound | Reflectable root compound zserio object. |
Implements zserio::IBasicWalkObserver< ALLOC >.
Definition at line 244 of file JsonWriter.h.
|
delete |
Copying and moving is disallowed!
|
delete |
Copying and moving is disallowed!
| void zserio::BasicJsonWriter< ALLOC >::setEnumerableFormat | ( | EnumerableFormat | enumerableFormat | ) |
Sets preferred formatting for enumerable types.
| enumerableFormat | Enumerable format to use. |
Definition at line 232 of file JsonWriter.h.
| void zserio::BasicJsonWriter< ALLOC >::setItemSeparator | ( | const BasicString< RebindAlloc< ALLOC, char > > & | itemSeparator | ) |
Sets custom item separator.
Use with caution since setting of a wrong separator can lead to invalid JSON output.
| itemSeparator | Item separator to set. |
Definition at line 220 of file JsonWriter.h.
| void zserio::BasicJsonWriter< ALLOC >::setKeySeparator | ( | const BasicString< RebindAlloc< ALLOC, char > > & | keySeparator | ) |
Sets custom key separator.
Use with caution since setting of a wrong separator can lead to invalid JSON output.
| keySeparator | Key separator to set. |
Definition at line 226 of file JsonWriter.h.
|
overridevirtual |
Called when a simple (or an unset compound or array - i.e. nullptr) value is reached.
| value | Reflectable simple value. |
| fieldInfo | Field info. |
| elementIndex | Element index in array or WALKER_NOT_ELEMENT if the value is not in array. |
Implements zserio::IBasicWalkObserver< ALLOC >.
Definition at line 293 of file JsonWriter.h.
|
staticconstexpr |
Default configuration for enumerable types.
Definition at line 70 of file JsonWriter.h.
|
staticconstexpr |
Default item separator used when indent is not set.
Definition at line 30 of file JsonWriter.h.
|
staticconstexpr |
Default item separator used when indent is set.
Definition at line 35 of file JsonWriter.h.
|
staticconstexpr |
Default key separator.
Definition at line 40 of file JsonWriter.h.