UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TJsonWriter< CharType, PrintPolicy > Class Template Reference

#include <JsonWriter.h>

+ Inheritance diagram for TJsonWriter< CharType, PrintPolicy >:

Public Member Functions

virtual ~TJsonWriter ()
 
int32 GetIndentLevel () const
 
bool CanWriteObjectStart () const
 
EJson GetCurrentElementType () const
 
void WriteObjectStart ()
 
template<typename IdentifierType >
void WriteObjectStart (IdentifierType &&Identifier)
 
void WriteObjectEnd ()
 
void WriteArrayStart ()
 
template<typename IdentifierType >
void WriteArrayStart (IdentifierType &&Identifier)
 
void WriteArrayEnd ()
 
void WriteValue (uint8 Value)
 
template<class FValue >
void WriteValue (FValue &&Value)
 
void WriteValue (FStringView Value)
 
void WriteValue (const FString &Value)
 
template<typename IdentifierType >
void WriteValue (IdentifierType &&Identifier, uint8 Value)
 
template<class FValue , typename IdentifierType >
void WriteValue (IdentifierType &&Identifier, FValue &&Value)
 
template<class ElementType , typename IdentifierType >
void WriteValue (IdentifierType &&Identifier, const TArray< ElementType > &Array)
 
template<typename IdentifierType , typename MapIdentifierType , class MapElementType >
void WriteValue (IdentifierType &&Identifier, const TMap< MapIdentifierType, MapElementType > &Map)
 
template<typename MapIdentifierType , class MapElementType >
void WriteValue (const TMap< MapIdentifierType, MapElementType > &Map)
 
void WriteValue (FStringView Identifier, const TCHAR *Value)
 
void WriteRawJSONValue (FStringView Identifier, FStringView Value)
 
void WriteRawJSONValue (FUtf8StringView Identifier, FUtf8StringView Value)
 
template<typename IdentifierType >
void WriteNull (IdentifierType &&Identifier)
 
void WriteValue (const TCHAR *Value)
 
void WriteRawJSONValue (FStringView Value)
 
void WriteRawJSONValue (FUtf8StringView Value)
 
void WriteNull ()
 
virtual bool Close ()
 
template<typename IdentifierType >
void WriteIdentifierPrefix (IdentifierType &&Identifier)
 

Static Public Member Functions

static TSharedRef< TJsonWriterCreate (FArchive *const Stream, int32 InitialIndentLevel=0)
 

Protected Member Functions

 TJsonWriter (FArchive *const InStream, int32 InitialIndentLevel)
 
bool CanWriteValueWithoutIdentifier () const
 
bool CanWriteObjectWithoutIdentifier () const
 
void WriteCommaIfNeeded ()
 
template<typename InCharType >
void WriteIdentifier (const InCharType *Identifier)
 
template<typename InCharType >
void WriteIdentifier (TStringView< InCharType > Identifier)
 
void WriteIdentifier (const FText &Identifier)
 
void WriteIdentifier (const FString &Identifier)
 
EJsonToken WriteValueOnly (bool Value)
 
EJsonToken WriteValueOnly (float Value)
 
EJsonToken WriteValueOnly (double Value)
 
EJsonToken WriteValueOnly (int32 Value)
 
EJsonToken WriteValueOnly (int64 Value)
 
EJsonToken WriteValueOnly (uint8 Value)
 
EJsonToken WriteValueOnly (uint32 Value)
 
EJsonToken WriteValueOnly (uint64 Value)
 
EJsonToken WriteValueOnly (TYPE_OF_NULLPTR)
 
EJsonToken WriteValueOnly (const TCHAR *Value)
 
EJsonToken WriteValueOnly (FStringView Value)
 
EJsonToken WriteValueOnly (FUtf8StringView Value)
 
template<typename ValueType >
EJsonToken WriteValueOnly (TSharedRef< ValueType > ValueRef)
 
template<typename ValueType >
EJsonToken WriteValueOnly (TSharedPtr< ValueType > ValuePtr)
 
template<typename... ValueTypes>
EJsonToken WriteValueOnly (const TVariant< ValueTypes... > &Variant)
 
template<typename MapIdentifierType , typename MapElementType >
EJsonToken WriteValueOnly (const TMap< MapIdentifierType, MapElementType > &Map)
 
template<typename ArrayElementType >
EJsonToken WriteValueOnly (const TArray< ArrayElementType > &Array)
 
virtual void WriteStringValue (FAnsiStringView String)
 
virtual void WriteStringValue (FStringView String)
 
virtual void WriteStringValue (const FString &String)
 
virtual void WriteStringValue (FUtf8StringView String)
 
virtual void WriteStringValue (const FUtf8String &String)
 
template<typename InCharType >
void WriteRawJSONValueImpl (FStringView Identifier, TStringView< InCharType > Value)
 
template<typename InCharType >
void WriteRawJSONValueImpl (TStringView< InCharType > Value)
 
template<typename InCharType >
void WriteEscapedString (TStringView< InCharType > InView)
 

Protected Attributes

FArchive *const Stream
 
TArray< EJsonStack
 
EJsonToken PreviousTokenWritten
 
int32 IndentLevel
 

Detailed Description

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
class TJsonWriter< CharType, PrintPolicy >

Template for Json writers.

Parameters
CharTypeThe type of characters to print, i.e. TCHAR or ANSICHAR.
PrintPolicyThe print policy to use when writing the output string (default = TPrettyJsonPrintPolicy).

Constructor & Destructor Documentation

◆ ~TJsonWriter()

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
virtual TJsonWriter< CharType, PrintPolicy >::~TJsonWriter ( )
inlinevirtual

◆ TJsonWriter()

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
TJsonWriter< CharType, PrintPolicy >::TJsonWriter ( FArchive *const  InStream,
int32  InitialIndentLevel 
)
inlineprotected

Creates and initializes a new instance.

Parameters
InStreamAn archive containing the input.
InitialIndentLevelThe initial indentation level.

Member Function Documentation

◆ CanWriteObjectStart()

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
bool TJsonWriter< CharType, PrintPolicy >::CanWriteObjectStart ( ) const
inline

◆ CanWriteObjectWithoutIdentifier()

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
bool TJsonWriter< CharType, PrintPolicy >::CanWriteObjectWithoutIdentifier ( ) const
inlineprotected

◆ CanWriteValueWithoutIdentifier()

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
bool TJsonWriter< CharType, PrintPolicy >::CanWriteValueWithoutIdentifier ( ) const
inlineprotected

◆ Close()

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
virtual bool TJsonWriter< CharType, PrintPolicy >::Close ( )
inlinevirtual

◆ Create()

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
static TSharedRef< TJsonWriter > TJsonWriter< CharType, PrintPolicy >::Create ( FArchive *const  Stream,
int32  InitialIndentLevel = 0 
)
inlinestatic

◆ GetCurrentElementType()

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
EJson TJsonWriter< CharType, PrintPolicy >::GetCurrentElementType ( ) const
inline

◆ GetIndentLevel()

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
int32 TJsonWriter< CharType, PrintPolicy >::GetIndentLevel ( ) const
inline

◆ WriteArrayEnd()

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
void TJsonWriter< CharType, PrintPolicy >::WriteArrayEnd ( )
inline

◆ WriteArrayStart() [1/2]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
void TJsonWriter< CharType, PrintPolicy >::WriteArrayStart ( )
inline

◆ WriteArrayStart() [2/2]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
void TJsonWriter< CharType, PrintPolicy >::WriteArrayStart ( IdentifierType &&  Identifier)
inline

◆ WriteCommaIfNeeded()

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
void TJsonWriter< CharType, PrintPolicy >::WriteCommaIfNeeded ( )
inlineprotected

◆ WriteEscapedString()

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
template<typename InCharType >
void TJsonWriter< CharType, PrintPolicy >::WriteEscapedString ( TStringView< InCharType InView)
inlineprotected

◆ WriteIdentifier() [1/4]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
void TJsonWriter< CharType, PrintPolicy >::WriteIdentifier ( const FString &  Identifier)
inlineprotected

◆ WriteIdentifier() [2/4]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
void TJsonWriter< CharType, PrintPolicy >::WriteIdentifier ( const FText Identifier)
inlineprotected

◆ WriteIdentifier() [3/4]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
template<typename InCharType >
void TJsonWriter< CharType, PrintPolicy >::WriteIdentifier ( const InCharType Identifier)
inlineprotected

◆ WriteIdentifier() [4/4]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
template<typename InCharType >
void TJsonWriter< CharType, PrintPolicy >::WriteIdentifier ( TStringView< InCharType Identifier)
inlineprotected

◆ WriteIdentifierPrefix()

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
void TJsonWriter< CharType, PrintPolicy >::WriteIdentifierPrefix ( IdentifierType &&  Identifier)
inline

WriteValue("Foo", Bar) should be equivalent to WriteIdentifierPrefix("Foo"), WriteValue(Bar)

◆ WriteNull() [1/2]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
void TJsonWriter< CharType, PrintPolicy >::WriteNull ( )
inline

◆ WriteNull() [2/2]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
void TJsonWriter< CharType, PrintPolicy >::WriteNull ( IdentifierType &&  Identifier)
inline

◆ WriteObjectEnd()

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
void TJsonWriter< CharType, PrintPolicy >::WriteObjectEnd ( )
inline

◆ WriteObjectStart() [1/2]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
void TJsonWriter< CharType, PrintPolicy >::WriteObjectStart ( )
inline

◆ WriteObjectStart() [2/2]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
void TJsonWriter< CharType, PrintPolicy >::WriteObjectStart ( IdentifierType &&  Identifier)
inline

◆ WriteRawJSONValue() [1/4]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
void TJsonWriter< CharType, PrintPolicy >::WriteRawJSONValue ( FStringView  Identifier,
FStringView  Value 
)
inline

◆ WriteRawJSONValue() [2/4]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
void TJsonWriter< CharType, PrintPolicy >::WriteRawJSONValue ( FStringView  Value)
inline

◆ WriteRawJSONValue() [3/4]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
void TJsonWriter< CharType, PrintPolicy >::WriteRawJSONValue ( FUtf8StringView  Identifier,
FUtf8StringView  Value 
)
inline

◆ WriteRawJSONValue() [4/4]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
void TJsonWriter< CharType, PrintPolicy >::WriteRawJSONValue ( FUtf8StringView  Value)
inline

◆ WriteRawJSONValueImpl() [1/2]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
template<typename InCharType >
void TJsonWriter< CharType, PrintPolicy >::WriteRawJSONValueImpl ( FStringView  Identifier,
TStringView< InCharType Value 
)
inlineprotected

◆ WriteRawJSONValueImpl() [2/2]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
template<typename InCharType >
void TJsonWriter< CharType, PrintPolicy >::WriteRawJSONValueImpl ( TStringView< InCharType Value)
inlineprotected

◆ WriteStringValue() [1/5]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
virtual void TJsonWriter< CharType, PrintPolicy >::WriteStringValue ( const FString &  String)
inlineprotectedvirtual

◆ WriteStringValue() [2/5]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
virtual void TJsonWriter< CharType, PrintPolicy >::WriteStringValue ( const FUtf8String String)
inlineprotectedvirtual

◆ WriteStringValue() [3/5]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
virtual void TJsonWriter< CharType, PrintPolicy >::WriteStringValue ( FAnsiStringView  String)
inlineprotectedvirtual

◆ WriteStringValue() [4/5]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
virtual void TJsonWriter< CharType, PrintPolicy >::WriteStringValue ( FStringView  String)
inlineprotectedvirtual

◆ WriteStringValue() [5/5]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
virtual void TJsonWriter< CharType, PrintPolicy >::WriteStringValue ( FUtf8StringView  String)
inlineprotectedvirtual

◆ WriteValue() [1/11]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
void TJsonWriter< CharType, PrintPolicy >::WriteValue ( const FString &  Value)
inline

◆ WriteValue() [2/11]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
void TJsonWriter< CharType, PrintPolicy >::WriteValue ( const TCHAR Value)
inline

◆ WriteValue() [3/11]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
void TJsonWriter< CharType, PrintPolicy >::WriteValue ( const TMap< MapIdentifierType, MapElementType > &  Map)
inline

◆ WriteValue() [4/11]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
void TJsonWriter< CharType, PrintPolicy >::WriteValue ( FStringView  Identifier,
const TCHAR Value 
)
inline

◆ WriteValue() [5/11]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
void TJsonWriter< CharType, PrintPolicy >::WriteValue ( FStringView  Value)
inline

◆ WriteValue() [6/11]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
template<class FValue >
void TJsonWriter< CharType, PrintPolicy >::WriteValue ( FValue &&  Value)
inline

◆ WriteValue() [7/11]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
template<class ElementType , typename IdentifierType >
void TJsonWriter< CharType, PrintPolicy >::WriteValue ( IdentifierType &&  Identifier,
const TArray< ElementType > &  Array 
)
inline

◆ WriteValue() [8/11]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
void TJsonWriter< CharType, PrintPolicy >::WriteValue ( IdentifierType &&  Identifier,
const TMap< MapIdentifierType, MapElementType > &  Map 
)
inline

◆ WriteValue() [9/11]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
template<class FValue , typename IdentifierType >
void TJsonWriter< CharType, PrintPolicy >::WriteValue ( IdentifierType &&  Identifier,
FValue &&  Value 
)
inline

◆ WriteValue() [10/11]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
void TJsonWriter< CharType, PrintPolicy >::WriteValue ( IdentifierType &&  Identifier,
uint8  Value 
)
inline

◆ WriteValue() [11/11]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
void TJsonWriter< CharType, PrintPolicy >::WriteValue ( uint8  Value)
inline

◆ WriteValueOnly() [1/17]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
EJsonToken TJsonWriter< CharType, PrintPolicy >::WriteValueOnly ( bool  Value)
inlineprotected

◆ WriteValueOnly() [2/17]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
EJsonToken TJsonWriter< CharType, PrintPolicy >::WriteValueOnly ( const TArray< ArrayElementType > &  Array)
inlineprotected

◆ WriteValueOnly() [3/17]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
EJsonToken TJsonWriter< CharType, PrintPolicy >::WriteValueOnly ( const TCHAR Value)
inlineprotected

◆ WriteValueOnly() [4/17]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
EJsonToken TJsonWriter< CharType, PrintPolicy >::WriteValueOnly ( const TMap< MapIdentifierType, MapElementType > &  Map)
inlineprotected

◆ WriteValueOnly() [5/17]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
template<typename... ValueTypes>
EJsonToken TJsonWriter< CharType, PrintPolicy >::WriteValueOnly ( const TVariant< ValueTypes... > &  Variant)
inlineprotected

◆ WriteValueOnly() [6/17]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
EJsonToken TJsonWriter< CharType, PrintPolicy >::WriteValueOnly ( double  Value)
inlineprotected

◆ WriteValueOnly() [7/17]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
EJsonToken TJsonWriter< CharType, PrintPolicy >::WriteValueOnly ( float  Value)
inlineprotected

◆ WriteValueOnly() [8/17]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
EJsonToken TJsonWriter< CharType, PrintPolicy >::WriteValueOnly ( FStringView  Value)
inlineprotected

◆ WriteValueOnly() [9/17]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
EJsonToken TJsonWriter< CharType, PrintPolicy >::WriteValueOnly ( FUtf8StringView  Value)
inlineprotected

◆ WriteValueOnly() [10/17]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
EJsonToken TJsonWriter< CharType, PrintPolicy >::WriteValueOnly ( int32  Value)
inlineprotected

◆ WriteValueOnly() [11/17]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
EJsonToken TJsonWriter< CharType, PrintPolicy >::WriteValueOnly ( int64  Value)
inlineprotected

◆ WriteValueOnly() [12/17]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
template<typename ValueType >
EJsonToken TJsonWriter< CharType, PrintPolicy >::WriteValueOnly ( TSharedPtr< ValueType >  ValuePtr)
inlineprotected

◆ WriteValueOnly() [13/17]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
template<typename ValueType >
EJsonToken TJsonWriter< CharType, PrintPolicy >::WriteValueOnly ( TSharedRef< ValueType >  ValueRef)
inlineprotected

◆ WriteValueOnly() [14/17]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
EJsonToken TJsonWriter< CharType, PrintPolicy >::WriteValueOnly ( TYPE_OF_NULLPTR  )
inlineprotected

◆ WriteValueOnly() [15/17]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
EJsonToken TJsonWriter< CharType, PrintPolicy >::WriteValueOnly ( uint32  Value)
inlineprotected

◆ WriteValueOnly() [16/17]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
EJsonToken TJsonWriter< CharType, PrintPolicy >::WriteValueOnly ( uint64  Value)
inlineprotected

◆ WriteValueOnly() [17/17]

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
EJsonToken TJsonWriter< CharType, PrintPolicy >::WriteValueOnly ( uint8  Value)
inlineprotected

Member Data Documentation

◆ IndentLevel

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
int32 TJsonWriter< CharType, PrintPolicy >::IndentLevel
protected

◆ PreviousTokenWritten

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
EJsonToken TJsonWriter< CharType, PrintPolicy >::PreviousTokenWritten
protected

◆ Stack

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
TArray<EJson> TJsonWriter< CharType, PrintPolicy >::Stack
protected

◆ Stream

template<class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>>
FArchive* const TJsonWriter< CharType, PrintPolicy >::Stream
protected

The documentation for this class was generated from the following files: