update cpp ue4 samples

This commit is contained in:
William Cheng 2021-04-20 21:47:12 +08:00
parent 28e0d9b22e
commit 41f586bede
2 changed files with 22 additions and 1 deletions

View File

@ -1 +1 @@
5.1.0-SNAPSHOT
5.1.1-SNAPSHOT

View File

@ -114,6 +114,11 @@ inline FStringFormatArg ToStringFormatArg(const FDateTime& Value)
return FStringFormatArg(Value.ToIso8601());
}
inline FStringFormatArg ToStringFormatArg(const FGuid& Value)
{
return FStringFormatArg(Value.ToString(EGuidFormats::DigitsWithHyphens));
}
inline FStringFormatArg ToStringFormatArg(const TArray<uint8>& Value)
{
return FStringFormatArg(Base64UrlEncode(Value));
@ -229,6 +234,11 @@ inline void WriteJsonValue(JsonWriter& Writer, const FDateTime& Value)
Writer->WriteValue(Value.ToIso8601());
}
inline void WriteJsonValue(JsonWriter& Writer, const FGuid& Value)
{
Writer->WriteValue(Value.ToString(EGuidFormats::DigitsWithHyphens));
}
inline void WriteJsonValue(JsonWriter& Writer, const Model& Value)
{
Value.WriteJson(Writer);
@ -290,6 +300,17 @@ inline bool TryGetJsonValue(const TSharedPtr<FJsonValue>& JsonValue, FDateTime&
return false;
}
inline bool TryGetJsonValue(const TSharedPtr<FJsonValue>& JsonValue, FGuid& Value)
{
FString TmpValue;
if (JsonValue->TryGetString(TmpValue))
{
return FGuid::Parse(TmpValue, Value);
}
else
return false;
}
inline bool TryGetJsonValue(const TSharedPtr<FJsonValue>& JsonValue, bool& Value)
{
bool TmpValue;