17template <
typename DstChar,
typename SrcChar>
32template<
typename StringType>
35 using CharType =
typename StringType::ElementType;
36 AppendTo +=
TEXT(
"\"");
41 case CHARTEXT(CharType,
'\\'): AppendTo +=
CHARTEXT(CharType,
"\\\\");
break;
47 case CHARTEXT(CharType,
'\"'): AppendTo +=
CHARTEXT(CharType,
"\\\"");
break;
60 AppendTo +=
CHARTEXT(CharType,
"\"");
83template <
class CharType = TCHAR,
class Pr
intPolicy = TPrettyJsonPr
intPolicy<CharType> >
116 PrintPolicy::WriteLineTerminator(
Stream);
120 PrintPolicy::WriteChar(
Stream, CharType(
'{'));
126 template<
typename IdentifierType>
132 PrintPolicy::WriteLineTerminator(
Stream);
134 PrintPolicy::WriteChar(
Stream, CharType(
'{'));
144 PrintPolicy::WriteLineTerminator(
Stream);
148 PrintPolicy::WriteChar(
Stream, CharType(
'}'));
160 PrintPolicy::WriteLineTerminator(
Stream);
164 PrintPolicy::WriteChar(
Stream, CharType(
'['));
170 template<
typename IdentifierType>
176 PrintPolicy::WriteSpace(
Stream );
177 PrintPolicy::WriteChar(
Stream, CharType(
'['));
191 PrintPolicy::WriteLineTerminator(
Stream);
195 PrintPolicy::WriteChar(
Stream, CharType(
']'));
208 PrintPolicy::WriteSpace(
Stream);
212 PrintPolicy::WriteLineTerminator(
Stream);
219 template <
class FValue>
227 PrintPolicy::WriteSpace(
Stream);
231 PrintPolicy::WriteLineTerminator(
Stream);
243 PrintPolicy::WriteLineTerminator(
Stream);
253 PrintPolicy::WriteLineTerminator(
Stream);
259 template<
typename IdentifierType>
265 PrintPolicy::WriteSpace(
Stream);
269 template<
class FValue,
typename IdentifierType>
275 PrintPolicy::WriteSpace(
Stream);
279 template<
class ElementType,
typename IdentifierType>
283 for (
int Idx = 0; Idx <
Array.Num(); Idx++)
290 template<
typename IdentifierType,
typename MapIdentifierType,
class MapElementType>
301 template<
typename MapIdentifierType,
class MapElementType>
331 template<
typename IdentifierType>
372 template<
typename IdentifierType>
377 PrintPolicy::WriteSpace(
Stream);
412 PrintPolicy::WriteChar(
Stream, CharType(
','));
418 template <
typename InCharType>
422 PrintPolicy::WriteLineTerminator(
Stream);
426 PrintPolicy::WriteChar(
Stream, CharType(
':'));
431 template <
typename InCharType>
435 PrintPolicy::WriteLineTerminator(
Stream);
439 PrintPolicy::WriteChar(
Stream, CharType(
':'));
452 PrintPolicy::WriteLineTerminator(
Stream);
456 PrintPolicy::WriteChar(
Stream, CharType(
':'));
533 template<
typename ValueType>
539 template<
typename ValueType>
552 template<
typename... ValueTypes>
561 template<
typename MapIdentifierType,
typename MapElementType>
574 template<
typename ArrayElementType>
578 for (
int Idx = 0; Idx <
Array.Num(); Idx++)
589 PrintPolicy::WriteChar(
Stream, CharType(
'"'));
591 PrintPolicy::WriteChar(
Stream, CharType(
'"'));
596 PrintPolicy::WriteChar(
Stream, CharType(
'"'));
598 PrintPolicy::WriteChar(
Stream, CharType(
'"'));
608 PrintPolicy::WriteChar(
Stream, CharType(
'"'));
610 PrintPolicy::WriteChar(
Stream, CharType(
'"'));
620 template <
typename InCharType>
626 PrintPolicy::WriteSpace(
Stream);
631 template <
typename InCharType>
639 PrintPolicy::WriteLineTerminator(
Stream);
644 PrintPolicy::WriteSpace(
Stream);
651 template<
typename InCharType>
695 InView.RightChopInline(EndIndex);
696 for (EndIndex = 0; EndIndex <
InView.Len(); ++EndIndex)
723 InView.RightChopInline(EndIndex);
734template <
class Pr
intPolicy = TPrettyJsonPr
intPolicy<TCHAR>>
736 :
public TJsonWriter<typename PrintPolicy::CharType, PrintPolicy>
781template <
class CharType = TCHAR,
class Pr
intPolicy = TPrettyJsonPr
intPolicy<CharType>>
#define check(expr)
Definition AssertionMacros.h:314
SharedPointerInternals::TRawPtrProxy< ObjectType > MakeShareable(ObjectType *InObject)
Definition SharedPointer.h:1947
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
EJsonToken
Definition JsonTypes.h:35
EJson
Definition JsonTypes.h:23
bool EJsonToken_IsShortValue(EJsonToken Token)
Definition JsonTypes.h:54
bool HasDestinationJsonStringCharRepresentation(SrcChar Char)
Definition JsonWriter.h:18
FString EscapeJsonString(const FString &StringVal)
Definition JsonWriter.h:71
StringType & AppendEscapeJsonString(StringType &AppendTo, const FString &StringVal)
Definition JsonWriter.h:33
TStringView< UTF8CHAR > FUtf8StringView
Definition StringFwd.h:48
TStringView< TCHAR > FStringView
Definition StringFwd.h:45
#define TEXTVIEW(str)
Definition StringView.h:553
decltype(auto) Visit(Func &&Callable, Variants &&... Args)
Definition TVariant.h:271
Definition Archive.h:1208
virtual bool Close()
Definition Archive.h:1847
Definition MemoryWriter.h:101
UE_REWRITE SizeType Num() const
Definition Array.h:1144
UE_NODEBUG UE_FORCEINLINE_HINT void Push(ElementType &&Item)
Definition Array.h:1224
ElementType Pop(EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:1196
UE_NODEBUG UE_FORCEINLINE_HINT ElementType & Top() UE_LIFETIMEBOUND
Definition Array.h:1248
Definition JsonWriter.h:737
virtual bool Close() override
Definition JsonWriter.h:755
static TSharedRef< TJsonStringWriter > Create(StringType *const InStream, int32 InitialIndent=0)
Definition JsonWriter.h:742
TString< CharType > StringType
Definition JsonWriter.h:740
typename PrintPolicy::CharType CharType
Definition JsonWriter.h:739
TJsonStringWriter(StringType *const InOutString, int32 InitialIndent)
Definition JsonWriter.h:769
virtual ~TJsonStringWriter()
Definition JsonWriter.h:749
Definition JsonWriter.h:783
static TSharedRef< TJsonWriter< CharType, PrintPolicy > > Create(StringType *const Stream, int32 InitialIndent=0)
Definition JsonWriter.h:792
static TSharedRef< TJsonWriter< CharType, PrintPolicy > > Create(FArchive *const Stream, int32 InitialIndent=0)
Definition JsonWriter.h:787
TString< CharType > StringType
Definition JsonWriter.h:785
Definition JsonWriter.h:85
void WriteRawJSONValueImpl(TStringView< InCharType > Value)
Definition JsonWriter.h:632
EJsonToken WriteValueOnly(double Value)
Definition JsonWriter.h:473
void WriteRawJSONValue(FUtf8StringView Value)
Definition JsonWriter.h:351
EJsonToken WriteValueOnly(int32 Value)
Definition JsonWriter.h:481
void WriteObjectStart(IdentifierType &&Identifier)
Definition JsonWriter.h:127
void WriteValue(const TCHAR *Value)
Definition JsonWriter.h:337
void WriteIdentifier(TStringView< InCharType > Identifier)
Definition JsonWriter.h:432
void WriteRawJSONValueImpl(FStringView Identifier, TStringView< InCharType > Value)
Definition JsonWriter.h:621
virtual void WriteStringValue(const FString &String)
Definition JsonWriter.h:601
EJsonToken WriteValueOnly(bool Value)
Definition JsonWriter.h:461
int32 GetIndentLevel() const
Definition JsonWriter.h:97
EJsonToken WriteValueOnly(FStringView Value)
Definition JsonWriter.h:521
EJsonToken WriteValueOnly(float Value)
Definition JsonWriter.h:467
void WriteValue(IdentifierType &&Identifier, const TMap< MapIdentifierType, MapElementType > &Map)
Definition JsonWriter.h:291
void WriteNull()
Definition JsonWriter.h:356
EJsonToken WriteValueOnly(int64 Value)
Definition JsonWriter.h:486
void WriteValue(uint8 Value)
Definition JsonWriter.h:201
virtual void WriteStringValue(FUtf8StringView String)
Definition JsonWriter.h:606
int32 IndentLevel
Definition JsonWriter.h:730
void WriteIdentifier(const InCharType *Identifier)
Definition JsonWriter.h:419
void WriteValue(IdentifierType &&Identifier, uint8 Value)
Definition JsonWriter.h:260
virtual void WriteStringValue(const FUtf8String &String)
Definition JsonWriter.h:613
void WriteObjectStart()
Definition JsonWriter.h:109
EJsonToken WriteValueOnly(uint64 Value)
Definition JsonWriter.h:503
EJsonToken WriteValueOnly(TSharedPtr< ValueType > ValuePtr)
Definition JsonWriter.h:540
bool CanWriteObjectStart() const
Definition JsonWriter.h:99
EJson GetCurrentElementType() const
Definition JsonWriter.h:104
void WriteIdentifier(const FString &Identifier)
Definition JsonWriter.h:449
EJsonToken WriteValueOnly(const TMap< MapIdentifierType, MapElementType > &Map)
Definition JsonWriter.h:562
void WriteValue(FStringView Identifier, const TCHAR *Value)
Definition JsonWriter.h:312
static TSharedRef< TJsonWriter > Create(FArchive *const Stream, int32 InitialIndentLevel=0)
Definition JsonWriter.h:88
void WriteObjectEnd()
Definition JsonWriter.h:140
virtual bool Close()
Definition JsonWriter.h:361
void WriteValue(FStringView Value)
Definition JsonWriter.h:238
EJsonToken PreviousTokenWritten
Definition JsonWriter.h:729
EJsonToken WriteValueOnly(FUtf8StringView Value)
Definition JsonWriter.h:527
void WriteRawJSONValue(FStringView Identifier, FStringView Value)
Definition JsonWriter.h:319
void WriteNull(IdentifierType &&Identifier)
Definition JsonWriter.h:332
void WriteArrayStart()
Definition JsonWriter.h:153
EJsonToken WriteValueOnly(const TCHAR *Value)
Definition JsonWriter.h:515
void WriteArrayStart(IdentifierType &&Identifier)
Definition JsonWriter.h:171
void WriteIdentifier(const FText &Identifier)
Definition JsonWriter.h:444
virtual void WriteStringValue(FAnsiStringView String)
Definition JsonWriter.h:587
void WriteValue(FValue &&Value)
Definition JsonWriter.h:220
EJsonToken WriteValueOnly(TSharedRef< ValueType > ValueRef)
Definition JsonWriter.h:534
void WriteValue(const TMap< MapIdentifierType, MapElementType > &Map)
Definition JsonWriter.h:302
virtual ~TJsonWriter()
Definition JsonWriter.h:95
void WriteArrayEnd()
Definition JsonWriter.h:183
TJsonWriter(FArchive *const InStream, int32 InitialIndentLevel)
Definition JsonWriter.h:389
void WriteIdentifierPrefix(IdentifierType &&Identifier)
Definition JsonWriter.h:373
void WriteValue(IdentifierType &&Identifier, FValue &&Value)
Definition JsonWriter.h:270
bool CanWriteObjectWithoutIdentifier() const
Definition JsonWriter.h:403
void WriteEscapedString(TStringView< InCharType > InView)
Definition JsonWriter.h:652
EJsonToken WriteValueOnly(TYPE_OF_NULLPTR)
Definition JsonWriter.h:509
void WriteValue(IdentifierType &&Identifier, const TArray< ElementType > &Array)
Definition JsonWriter.h:280
bool CanWriteValueWithoutIdentifier() const
Definition JsonWriter.h:398
void WriteRawJSONValue(FStringView Value)
Definition JsonWriter.h:344
EJsonToken WriteValueOnly(const TVariant< ValueTypes... > &Variant)
Definition JsonWriter.h:553
FArchive *const Stream
Definition JsonWriter.h:727
virtual void WriteStringValue(FStringView String)
Definition JsonWriter.h:594
EJsonToken WriteValueOnly(const TArray< ArrayElementType > &Array)
Definition JsonWriter.h:575
void WriteCommaIfNeeded()
Definition JsonWriter.h:408
TArray< EJson > Stack
Definition JsonWriter.h:728
void WriteValue(const FString &Value)
Definition JsonWriter.h:248
void WriteRawJSONValue(FUtf8StringView Identifier, FUtf8StringView Value)
Definition JsonWriter.h:326
EJsonToken WriteValueOnly(uint32 Value)
Definition JsonWriter.h:498
EJsonToken WriteValueOnly(uint8 Value)
Definition JsonWriter.h:493
Definition UnrealString.h.inl:34
Definition SharedPointer.h:692
UE_FORCEINLINE_HINT const bool IsValid() const
Definition SharedPointer.h:1085
Definition SharedPointer.h:153
BuilderType & Appendf(const FmtType &Fmt, Types... Args)
Definition StringBuilder.h:419
ViewType ToView() const UE_LIFETIMEBOUND
Definition StringBuilder.h:165
Definition StringBuilder.h:509
ViewType Left(int32 CharCount) const
Definition StringView.h:580