Struct JsonStringSerializer
Serializer for a range based plain JSON string representation.
struct JsonStringSerializer(R, bool pretty = false)
if (isInputRange!R || isOutputRange!(R, char));
Constructors
Name | Description |
---|---|
this
(range)
|
Fields
Name | Type | Description |
---|---|---|
m_firstInComposite
|
bool | |
m_level
|
size_t | |
m_line
|
int | |
m_range
|
R |
Methods
Name | Description |
---|---|
beginReadArrayEntry
(index)
|
|
beginReadDictionaryEntry
(name)
|
|
beginWriteArray
()
|
|
beginWriteArrayEntry
()
|
|
beginWriteDictionary
()
|
|
beginWriteDictionaryEntry
(name)
|
|
endComposite
()
|
|
endReadArrayEntry
(index)
|
|
endReadDictionaryEntry
(name)
|
|
endWriteArray
()
|
|
endWriteArrayEntry
()
|
|
endWriteDictionary
()
|
|
endWriteDictionaryEntry
(name)
|
|
getSerializedResult
()
|
|
indent
()
|
|
readArray
(size_callback, entry_callback)
|
|
readDictionary
(entry_callback)
|
|
readValue
()
|
|
startComposite
()
|
|
startCompositeEntry
()
|
|
tryReadNull
()
|
|
writeValue
(value)
|
See Also
vibe.data.serialization.serialize, vibe.data.serialization.deserialize, serializeToJson, deserializeJson
Example
Cloning JSON arrays
Json value = Json([ Json([ Json .emptyArray ]), Json .emptyArray ]) .clone;
assert(value .length == 2);
assert(value[0] .length == 1);
assert(value[0][0] .length == 0);