UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
VVMJson.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Dom/JsonObject.h"
6
7namespace Verse
8{
9struct VCell;
10struct VValue;
11
12// constants for Persistence JSON
13namespace Persistence
14{
15constexpr TCHAR PackageNameKey[] = TEXT("$package_name");
16constexpr TCHAR ClassNameKey[] = TEXT("$class_name");
17constexpr TCHAR KeyKey[] = TEXT("k");
18constexpr TCHAR ValueKey[] = TEXT("v");
19} // namespace Persistence
20
21// constants for Persona JSON
22namespace Persona
23{
24constexpr TCHAR StringString[] = TEXT("STRING");
25constexpr TCHAR NumberString[] = TEXT("NUMBER");
26constexpr TCHAR ObjectString[] = TEXT("OBJECT");
27constexpr TCHAR ArrayString[] = TEXT("ARRAY");
28constexpr TCHAR BooleanString[] = TEXT("BOOLEAN");
29constexpr TCHAR IntegerString[] = TEXT("INTEGER");
30constexpr TCHAR EnumString[] = TEXT("ENUM");
31
32constexpr TCHAR ItemsString[] = TEXT("items");
33constexpr TCHAR MaximumString[] = TEXT("maximum");
34constexpr TCHAR MinimumString[] = TEXT("minimum");
35constexpr TCHAR PropertiesString[] = TEXT("properties");
36constexpr TCHAR RequiredString[] = TEXT("required");
37constexpr TCHAR TypeString[] = TEXT("type");
38constexpr TCHAR AnyOfString[] = TEXT("any_of");
39constexpr TCHAR KeyString[] = TEXT("key");
40constexpr TCHAR ValueString[] = TEXT("value");
41
42constexpr TCHAR SchemaString[] = TEXT("$schema");
43constexpr TCHAR SchemaLink[] = TEXT("https://ai.google.dev/api/caching#Schema");
44} // namespace Persona
45
47{
48 Analytics, // Basic JSON, no schema
49 Persistence, // Persistence JSON
50 Persona // Persona JSON, types implementing this should output themselves according to https://ai.google.dev/api/caching#Schema
51};
52
53enum class EVisitState
54{
57};
58
59// To handle case differences for field names in Persona/Analytics which are otherwise the same, as analytics prefers PascalCase
60#define PERSONA_FIELD(Name) Format == EValueJSONFormat::Persona ? Persona::Name##String : TEXT(#Name)
61
62#if WITH_VERSE_VM
63struct FRunningContext;
64
65// This callback is used by `VValue::ToJSON` and is called before any other evaluation is done to allow callers to add custom handling
66// If it returs nullptr, default handling is used
67// Note: be careful of calling `VCell::ToJson` directly as that bypasses this callback
69
71#endif
72
74
76
79
82
83} // namespace Verse
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::int64 int64
A 64-bit signed integer.
Definition Platform.h:1127
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition JsonObject.h:23
Definition JsonValue.h:22
Definition UnrealString.h.inl:34
Definition SharedPointer.h:692
Definition SharedPointer.h:153
constexpr TCHAR ValueKey[]
Definition VVMJson.h:18
constexpr TCHAR PackageNameKey[]
Definition VVMJson.h:15
constexpr TCHAR KeyKey[]
Definition VVMJson.h:17
constexpr TCHAR ClassNameKey[]
Definition VVMJson.h:16
constexpr TCHAR ObjectString[]
Definition VVMJson.h:26
constexpr TCHAR KeyString[]
Definition VVMJson.h:39
constexpr TCHAR SchemaLink[]
Definition VVMJson.h:43
constexpr TCHAR NumberString[]
Definition VVMJson.h:25
constexpr TCHAR ArrayString[]
Definition VVMJson.h:27
constexpr TCHAR TypeString[]
Definition VVMJson.h:37
constexpr TCHAR SchemaString[]
Definition VVMJson.h:42
constexpr TCHAR MaximumString[]
Definition VVMJson.h:33
constexpr TCHAR AnyOfString[]
Definition VVMJson.h:38
constexpr TCHAR IntegerString[]
Definition VVMJson.h:29
constexpr TCHAR BooleanString[]
Definition VVMJson.h:28
constexpr TCHAR ValueString[]
Definition VVMJson.h:40
constexpr TCHAR StringString[]
Definition VVMJson.h:24
constexpr TCHAR RequiredString[]
Definition VVMJson.h:36
constexpr TCHAR PropertiesString[]
Definition VVMJson.h:35
constexpr TCHAR MinimumString[]
Definition VVMJson.h:34
constexpr TCHAR EnumString[]
Definition VVMJson.h:30
constexpr TCHAR ItemsString[]
Definition VVMJson.h:32
Definition Archive.h:36
TSharedRef< FJsonValue > Int64ToJson(int64 Arg)
Definition VVMJson.cpp:24
EValueJSONFormat
Definition VVMJson.h:47
EVisitState
Definition VVMJson.h:54
bool TryGetInt64(const FJsonValue &JsonValue, int64 &Int64Value)
Definition VVMJson.cpp:29
TSharedPtr< FJsonValue > Unwrap(const TSharedPtr< FJsonValue > &Value, EValueJSONFormat Format)
Definition VVMJson.cpp:74