UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
VVMNames.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
7#include "CoreMinimal.h"
9#include "VerseVM/VVMVerse.h"
10
11namespace Verse::Names
12{
13static constexpr int32 DefaultNameLength = 64;
14
15//--------------------------------------------------------------------------------------------------------------------
16// Private helper methods that should not be used outside of Verse/Solaris code
17//--------------------------------------------------------------------------------------------------------------------
18
19namespace Private
20{
21
22//--------------------------------------------------------------------------------------------------------------------
23// Name mangling to make a cased name a cassless name
24//--------------------------------------------------------------------------------------------------------------------
25
26// The following method are intended to take a case sensitive name (which maybe already adorned with package information)
27// and convert it into a case insensitive name. This is done by prepending a CRC of the name. The Crc is calculated on the
28// CrcName, which is a qualified name in the case of fields in interfaces. Otherwise it's the same as Name.
31
32//--------------------------------------------------------------------------------------------------------------------
33// Encoding and decoding
34//--------------------------------------------------------------------------------------------------------------------
35
36// Encode and decode a verse names. This is currently only used to encode functions.
37// The method takes characters that could be considered invalid for UE names and makes them valid
42} // namespace Private
43
44//--------------------------------------------------------------------------------------------------------------------
45// String constants
46//--------------------------------------------------------------------------------------------------------------------
47
48// Create Get methods to return the given constant strings
49#define UE_MAKE_CONSTANT_STRING_METHODS(Name, Text) \
50 template <typename CharType> \
51 const CharType* Get##Name(); \
52 template <> \
53 V_FORCEINLINE const UTF8CHAR* Get##Name<UTF8CHAR>() \
54 { \
55 return UTF8TEXT(Text); \
56 } \
57 template <> \
58 V_FORCEINLINE const TCHAR* Get##Name<TCHAR>() \
59 { \
60 return TEXT(Text); \
61 }
62
63UE_MAKE_CONSTANT_STRING_METHODS(VerseSubPath, "_Verse")
68
69#undef UE_MAKE_CONSTANT_STRING_METHODS
70
71//--------------------------------------------------------------------------------------------------------------------
72// UE Package names for Verse
73//--------------------------------------------------------------------------------------------------------------------
74
75// The following methods assist in generating the UE package names
76
77template <typename CharType>
81
82template <typename CharType>
86
87template <typename CharType>
91
92template <typename CharType>
96
97template <typename CharType>
101
102template <typename CharType>
106
107template <typename CharType>
111
112template <typename CharType>
116
117template <typename CharType>
121
122template <typename CharType>
126
127template <typename CharType>
131
132template <typename CharType>
136
137//--------------------------------------------------------------------------------------------------------------------
138// Verse path helper methods
139//--------------------------------------------------------------------------------------------------------------------
140
141// Test to see if the given path is a full Verse path (begins with open parenthesis)
143{
144 return Name.Len() > 0 && Name[0] == UTF8CHAR('(');
145}
147{
148 return Name.Len() > 0 && Name[0] == TCHAR('(');
149}
151{
152 int32 Index = 0;
153 if (QualifiedName.FindChar(UTF8CHAR(')'), Index))
154 {
155 QualifiedName.RemovePrefix(Index + 1);
156 }
157 return QualifiedName;
158}
160{
161 int32 Index = 0;
162 if (QualifiedName.FindChar(')', Index))
163 {
164 QualifiedName.RemovePrefix(Index + 1);
165 }
166 return QualifiedName;
167}
168
169//--------------------------------------------------------------------------------------------------------------------
170// Property name conversions
171//
172// NOTE: VVMULangNames.h contains helper methods specific to uLang types
173//--------------------------------------------------------------------------------------------------------------------
174
175// Convert a Verse property name to a UE name as a string
176// If bWasVerseName is true, then the name needed to be modified to be used as a UE name
179
180// Convert a Verse property name to a UE name as an FName. If the resulting name is too long, the engine will check.
181// If bWasVerseName is true, then the name needed to be modified to be used as a UE name
184
185// Convert a UE property name to the original Verse name.
186// WARNING: The resulting string is case sensitive and should NEVER be converted to an FName
187// If bIsVerseName is true, then the UE name was originally a verse name.
188COREUOBJECT_API FString UEPropToVerseName(FStringView UEName, bool* bIsVerseName = nullptr);
189COREUOBJECT_API FString UEPropToVerseName(FName UEName, bool* bIsVerseName = nullptr);
190
191// WARNING: This version is commonly used to signal that the code is depending on the verse name
192// being stored in an FName which is not valid.
195
196//--------------------------------------------------------------------------------------------------------------------
197// Function name conversions
198//
199// NOTE: VVMULangNames.h contains helper methods specific to uLang types
200//--------------------------------------------------------------------------------------------------------------------
201
202// Convert a Verse function name to a UE name as a string
204
205// Convert a Verse function name to a UE name as an FName. If the resulting name is too long, the engine will check.
207
208// Convert a UE function name to the original Verse name.
209// WARNING: The resulting string is case sensitive and should NEVER be converted to an FName
210// If bIsVerseName is true, then the UE name was originally a verse name.
213
214//--------------------------------------------------------------------------------------------------------------------
215// Methods to handle the VERSE_DEAD_ prefix
216//--------------------------------------------------------------------------------------------------------------------
217
218// Return the verse dead prefix
220
221// Test to see if the given name has the prefix
223
224// Add the verse dead prefix. Will not add a prefix if one already exists
226
227// Remove the verse dead prefix if it exists
229
230// Rename the given type to dead and move it to the given new outer
232
233// Get the decorated verse name for a property on a UVerseClass or a UVerseStruct
235} // namespace Verse::Names
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
FPlatformTypes::UTF8CHAR UTF8CHAR
An 8-bit character containing a UTF8 (Unicode, 8-bit, variable-width) code unit.
Definition Platform.h:1137
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UE_MAKE_CONSTANT_STRING_METHODS(Name, Text)
Definition VVMNames.h:49
EVersePackageType
Definition VVMPackageTypes.h:22
Definition NameTypes.h:617
Definition UnrealType.h:174
Definition StringBuilder.h:509
void RemovePrefix(int32 CharCount)
Definition StringView.h:188
bool FindChar(CharType Search, int32 &OutIndex) const
Definition StringView.h:756
Definition Object.h:95
Definition OverriddenPropertySet.cpp:45
FString MangleCasedName(FStringView Name, FStringView CrcName, bool *bOutNameWasMangled)
Definition VVMNames.cpp:47
FUtf8String EncodeName(FUtf8StringView Path)
Definition VVMNames.cpp:92
FString UnmangleCasedName(const FName MaybeMangledName, bool *bOutNameWasMangled)
Definition VVMNames.cpp:72
FUtf8String DecodeName(FUtf8StringView Path)
Definition VVMNames.cpp:167
Definition VVMNames.cpp:15
FStringView RemoveVerseDeadPrefix(FStringView Name)
Definition VVMNames.cpp:517
FStringView GetVerseDeadPrefix()
Definition VVMNames.cpp:502
FName VersePropToUEFName(FStringView VerseName, FStringView CrcVerseName, bool *bWasVerseName)
Definition VVMNames.cpp:433
void MakeTypeDead(UObject *Object, UObject *NewOuter)
Definition VVMNames.cpp:522
TStringBuilderWithBuffer< CharType, DefaultNameLength > GetVersePackageNameForVni(TStringView< CharType > MountPointName, TStringView< CharType > CppModuleName)
Definition VVMNames.cpp:281
TStringBuilderWithBuffer< CharType, DefaultNameLength > GetUPackagePath(TStringView< CharType > VersePackageName, EVersePackageType *OutPackageType)
Definition VVMNames.cpp:362
TStringBuilderWithBuffer< CharType, DefaultNameLength > GetDecoratedName(TStringView< CharType > Path, TStringView< CharType > Module, TStringView< CharType > Name)
Definition VVMNames.cpp:256
TStringBuilderWithBuffer< CharType, DefaultNameLength > GetVersePackageNameForPublishedContent(TStringView< CharType > MountPointName)
Definition VVMNames.cpp:299
TStringBuilderWithBuffer< CharType, DefaultNameLength > GetUPackagePathForContent(TStringView< CharType > MountPointName)
Definition VVMNames.cpp:344
FString VersePropToUEName(FStringView VerseName, FStringView CrcVerseName, bool *bWasVerseName)
Definition VVMNames.cpp:402
bool IsFullPath(FUtf8StringView Name)
Definition VVMNames.h:142
TStringBuilderWithBuffer< CharType, DefaultNameLength > GetVersePackageDirForContent(TStringView< CharType > MountPointName)
Definition VVMNames.cpp:317
FString AddVerseDeadPrefix(FStringView Name)
Definition VVMNames.cpp:512
FString VerseFuncToUEName(FStringView VerseName)
Definition VVMNames.cpp:482
TStringBuilderWithBuffer< CharType, DefaultNameLength > GetVersePackageNameForContent(TStringView< CharType > MountPointName)
Definition VVMNames.cpp:290
FString UEPropToVerseName(FStringView UEName, bool *bIsVerseName)
Definition VVMNames.cpp:443
TStringBuilderWithBuffer< CharType, DefaultNameLength > GetUPackagePathForVni(TStringView< CharType > MountPointName, TStringView< CharType > CppModuleName)
Definition VVMNames.cpp:335
TStringBuilderWithBuffer< CharType, DefaultNameLength > GetVersePackageNameForAssets(TStringView< CharType > MountPointName)
Definition VVMNames.cpp:308
bool HasVerseDeadPrefix(FStringView Name)
Definition VVMNames.cpp:507
TStringBuilderWithBuffer< CharType, DefaultNameLength > GetVersePackageDirForAssets(TStringView< CharType > MountPointName)
Definition VVMNames.cpp:326
TStringBuilderWithBuffer< CharType, DefaultNameLength > GetUPackagePathForAssets(TStringView< CharType > MountPointName)
Definition VVMNames.cpp:353
FName VerseFuncToUEFName(FStringView VerseName)
Definition VVMNames.cpp:487
FName UEPropToVerseFName(FName UEName, bool *bIsVerseName)
Definition VVMNames.cpp:466
FUtf8StringView RemoveQualifier(FUtf8StringView QualifiedName)
Definition VVMNames.h:150
FString UEFuncToVerseName(FStringView UEName)
Definition VVMNames.cpp:492
U16 Index
Definition radfft.cpp:71