79 template<
class CharType>
85 template<
class CharType>
91 template<
class CharType>
97 template<
class CharType>
100 if (*Str ==
'-' || *Str ==
'+')
122 template<
class CharType>
140 template<
class CharType,
class Pr
intPolicy>
143 if(Element->Value.IsType<
bool>())
147 Writer.
WriteValue(Element->Value.Get<
bool>());
151 Writer.
WriteValue(Element->Identifier, Element->Value.Get<
bool>());
160 template<
class CharType,
class Pr
intPolicy>
163 if (Element->Value.IsType<
long long>())
167 Writer.
WriteValue(Element->Value.Get<
long long>());
171 Writer.
WriteValue(Element->Identifier, Element->Value.Get<
long long>());
176 else if(Element->Value.IsType<
double>())
180 Writer.
WriteValue(Element->Value.Get<
double>());
184 Writer.
WriteValue(Element->Identifier, Element->Value.Get<
double>());
193 template<
class CharType,
class Pr
intPolicy>
196 if(Element->Value.IsType<FString>())
200 Writer.
WriteValue(Element->Value.Get<FString>());
204 Writer.
WriteValue(Element->Identifier, Element->Value.Get<FString>());
213 template<
class CharType,
class Pr
intPolicy>
219 template<
class CharType,
class Pr
intPolicy>
224 if (Element->bHasBeenProcessed)
230 Element->bHasBeenProcessed =
true;
256 template<
class CharType,
class Pr
intPolicy>
261 if (Element->bHasBeenProcessed)
267 Element->bHasBeenProcessed =
true;
282 for (
const FNestedVariantJson::FMap::ElementType& Entry : *
ElementMap)
286 Values.
Add(Entry.Value);
#define check(expr)
Definition AssertionMacros.h:314
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
return true
Definition ExternalRpcRegistry.cpp:601
EJson
Definition JsonTypes.h:23
COREONLINE_API void NestedVariantFromJsonObject(const TSharedPtr< FJsonObject > &JsonObject, FNestedVariantJson::FMapRef &Map)
Definition NestedVariantJson.cpp:55
COREONLINE_API void NestedVariantFromJson(const char *InJson, FNestedVariantJson::FMapRef &Map)
Definition NestedVariantJson.cpp:38
COREONLINE_API FString NestedVariantToJson(const FNestedVariantJson::FMapPtr &Map)
Definition NestedVariantJson.cpp:13
COREONLINE_API TSharedRef< FJsonObject > NestedVariantToJsonObject(const FNestedVariantJson::FMapRef &Map)
Definition NestedVariantJson.cpp:28
COREONLINE_API void LexFromString(FNestedVariantJson::FMap &OutValue, const TCHAR *InString)
Definition NestedVariantJson.cpp:64
Definition JsonObject.h:23
Definition JsonValue.h:22
UE_REWRITE SizeType Num() const
Definition Array.h:1144
UE_NODEBUG UE_FORCEINLINE_HINT SizeType Add(ElementType &&Item)
Definition Array.h:2696
Definition JsonReader.h:41
double GetValueAsNumber() const
Definition JsonReader.h:192
std::conditional_t< std::is_same_v< CharType, ANSICHAR >, FUtf8String, TString< CharType > > StoredStringType
Definition JsonReader.h:44
virtual StoredStringType StealInternalValueAsString()
Definition JsonReader.h:186
bool GetValueAsBoolean() const
Definition JsonReader.h:204
const StoredStringType & GetValueAsNumberString() const
Definition JsonReader.h:198
Definition JsonWriter.h:85
void WriteValue(uint8 Value)
Definition JsonWriter.h:201
void WriteObjectStart()
Definition JsonWriter.h:109
void WriteObjectEnd()
Definition JsonWriter.h:140
void WriteArrayStart()
Definition JsonWriter.h:153
void WriteArrayEnd()
Definition JsonWriter.h:183
Definition NestedVariant.h:662
Definition NestedVariant.h:696
TNestedVariantArrayPtr< KeyType, ValueTypes... > FArrayPtr
Definition NestedVariant.h:700
FNestedVariantValue< KeyType, ValueTypes... > FValue
Definition NestedVariant.h:706
TNestedVariantMapPtr< KeyType, ValueTypes... > FMapPtr
Definition NestedVariant.h:704
Definition SharedPointer.h:692
Definition SharedPointer.h:153
UE_FORCEINLINE_HINT TSharedPtr< ObjectType, Mode > ToSharedPtr() const
Definition SharedPointer.h:454
void Set(typename TIdentity< U >::Type &&Value)
Definition TVariant.h:193
U16 Index
Definition radfft.cpp:71
Definition NestedVariantJson.h:40
FElement(const FValue &InValue)
Definition NestedVariantJson.h:41
bool bHasBeenProcessed
Definition NestedVariantJson.h:66
FString Identifier
Definition NestedVariantJson.h:64
FValue Value
Definition NestedVariantJson.h:65
FElement(const FString &InIdentifier, const FValue &InValue)
Definition NestedVariantJson.h:58
FElement(const FArrayOfValues &Array)
Definition NestedVariantJson.h:52
FElement(const FMapOfValues &Object)
Definition NestedVariantJson.h:46
bool bIsKeyValuePair
Definition NestedVariantJson.h:67
Definition NestedVariantJson.h:32
EJson Type
Definition NestedVariantJson.h:33
FString Identifier
Definition NestedVariantJson.h:34
FNestedVariantJson::FMapPtr Object
Definition NestedVariantJson.h:36
FNestedVariantJson::FArrayPtr Array
Definition NestedVariantJson.h:35
Definition NestedVariantJson.h:26
static COREONLINE_API bool GetValueFromState(const StackState &State, FMapOfValues &OutMap)
static COREONLINE_API bool GetValueFromState(const StackState &State, FValue &OutValue)
Definition NestedVariantJson.cpp:72
static void ReadNumberAsString(TJsonReader< CharType > &Reader, FValue &OutValue)
Definition NestedVariantJson.h:92
static bool SerializeIfBool(TSharedRef< FElement > &Element, TJsonWriter< CharType, PrintPolicy > &Writer, bool bWriteValueOnly)
Definition NestedVariantJson.h:141
static bool SerializeIfNull(TSharedRef< FElement > &Element, TJsonWriter< CharType, PrintPolicy > &Writer, bool bWriteValueOnly)
Definition NestedVariantJson.h:214
static COREONLINE_API void ReadObjectEnd(StackState &State, FValue &OutValue)
Definition NestedVariantJson.cpp:142
static COREONLINE_API void ReadArrayEnd(StackState &State, FValue &OutValue)
Definition NestedVariantJson.cpp:153
static bool SerializeIfArray(TArray< TSharedRef< FElement > > &ElementStack, TSharedRef< FElement > &Element, TJsonWriter< CharType, PrintPolicy > &Writer, bool bWriteValueOnly)
Definition NestedVariantJson.h:220
static COREONLINE_API void ReadObjectStart(StackState &State)
Definition NestedVariantJson.cpp:136
static void ReadBoolean(TJsonReader< CharType > &Reader, FValue &OutValue)
Definition NestedVariantJson.h:80
static bool IsNumberStringInteger(const CharType *Str)
Definition NestedVariantJson.h:98
static COREONLINE_API void ResetValue(FValue &OutValue)
Definition NestedVariantJson.cpp:131
static void ReadNull(FValue &OutValue)
Definition NestedVariantJson.cpp:158
static bool SerializeIfNumber(TSharedRef< FElement > &Element, TJsonWriter< CharType, PrintPolicy > &Writer, bool bWriteValueOnly)
Definition NestedVariantJson.h:161
static void AddValueToArray(StackState &State, FValue &NewValue)
Definition NestedVariantJson.cpp:167
static COREONLINE_API void ReadArrayStart(StackState &State)
Definition NestedVariantJson.cpp:147
static void ReadNumber(TJsonReader< CharType > &Reader, FValue &OutValue)
Definition NestedVariantJson.h:123
static void AddValueToObject(StackState &State, const FString &Identifier, FValue &NewValue)
Definition NestedVariantJson.cpp:162
static bool SerializeIfObject(TArray< TSharedRef< FElement > > &ElementStack, TSharedRef< FElement > &Element, TJsonWriter< CharType, PrintPolicy > &Writer, bool bWriteValueOnly)
Definition NestedVariantJson.h:257
static void ReadString(TJsonReader< CharType > &Reader, FValue &OutValue)
Definition NestedVariantJson.h:86
FNestedVariantJson::FValue FValue
Definition NestedVariantJson.h:27
static bool SerializeIfString(TSharedRef< FElement > &Element, TJsonWriter< CharType, PrintPolicy > &Writer, bool bWriteValueOnly)
Definition NestedVariantJson.h:194
static bool IsDigit(CharType Char)
Definition Char.h:240