Navigation
API > API/Runtime > API/Runtime/Json > API/Runtime/Json/Serialization > API/Runtime/Json/Serialization/FJsonSerializer > API/Runtime/Json/Serialization/FJsonSerializer/Serialize
References
Module | Json |
Header | /Engine/Source/Runtime/Json/Public/Serialization/JsonSerializer.h |
Include | #include "Serialization/JsonSerializer.h" |
template<class CharType, class PrintPolicy>
static bool Serialize
(
const TSharedPtr < FJsonValue > & Value,
const FString & Identifier,
TJsonWriter < CharType, PrintPolicy > & Writer,
bool bCloseWriter
)
Remarks
Serialize the passed Json value and identifier into the writer. Empty string identifiers will be ignored when the writer is not writing inside of a json object and only the value will be serialized. If the writer is in a state where it's currently writing inside of a json object, then the identifier will always be serialized. Examples:
- Writer state: { "foo": "bar"
Parameters: Identifier: "" Value: "baz" Serialization result: { "foo": "bar", "": "baz" //empty identifier is serialized as a valid key for the key:value pair "":"baz"
Writer state: { "foo": ["bar"
Parameters
Name | Description |
---|---|
Value | The json value we are serializing |
Identifier | The identifier of the value, empty identifiers are ignored outside of json objects. |
Writer | The writer the value and identifier are written into. |
bCloseWriter | When set to true the Writer will be closed after the serialization. |