Navigation
API > API/Runtime > API/Runtime/CoreUObject
Reflection data for an enumeration.
| Name | UEnum |
| Type | class |
| Header File | /Engine/Source/Runtime/CoreUObject/Public/UObject/Class.h |
| Include Path | #include "UObject/Class.h" |
Syntax
UCLASS (MinimalAPI, Config=Engine)
class UEnum : public UField
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UField → UEnum
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UEnum
(
const FObjectInitializer& ObjectInitialzer |
UObject/Class.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~UEnum() |
UObject/Class.h |
Classes
| Name | Remarks |
|---|---|
| FNameData |
Enums
Public
| Name | Remarks |
|---|---|
| ECppForm | How this enum is declared in C++, affects the internal naming of enum values |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| AllEnumNames | TMap< FName, TMap< FName, UEnum * > > | Global list of all value names used by all enums in memory, used for property text import | UObject/Class.h |
| AllEnumNamesLock | FRWLock | Lock to be taken when accessing AllEnumNames | UObject/Class.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| CppType | FString | This will be the true type of the enum as a string, e.g. "ENamespacedEnum::InnerType" or "ERegularEnum" or "EEnumClass" | UObject/Class.h | |
| UEnum | union UEnum | UObject/Class.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool ContainsExistingMax() |
Tests if the enum contains a MAX value | UObject/Class.h | |
bool FindAuthoredNameStringByValue
(
FString& Out, |
Looks for a display name with a given value and returns true and writes the unlocalized logical name to Out if one was found | UObject/Class.h | |
bool FindDisplayNameTextByValue
(
FText& Out, |
Looks for a display name with a given value and returns true and writes the name to Out if one was found | UObject/Class.h | |
bool FindNameStringByValue
(
FString& Out, |
Looks for a name with a given value and returns true and writes the name to Out if one was found | UObject/Class.h | |
| Find the longest common prefix of all items in the enumeration. | UObject/Class.h | ||
virtual FString GenerateFullEnumName
(
const TCHAR* InEnumName |
Generates full name including EnumName:: given enum name. | UObject/Class.h | |
virtual FString GetAuthoredNameStringByIndex
(
int32 InIndex |
Returns the unlocalized logical name originally assigned to the enum at creation. | UObject/Class.h | |
FString GetAuthoredNameStringByValue
(
int64 InValue |
Version of GetAuthoredNameByIndex that takes a value instead | UObject/Class.h | |
ECppForm GetCppForm() |
Returns the type of enum: whether it's a regular enum, namespaced enum or C++11 enum class. | UObject/Class.h | |
virtual FText GetDisplayNameTextByIndex
(
int32 InIndex |
Finds the localized display name or native display name as a fallback. | UObject/Class.h | |
FText GetDisplayNameTextByValue
(
int64 InValue |
Version of GetDisplayNameTextByIndex that takes a value instead | UObject/Class.h | |
int32 GetIndexByName
(
FName InName, |
Gets index of name in enum, returns INDEX_NONE and optionally errors when name is not found. | UObject/Class.h | |
int32 GetIndexByNameString
(
const FString& SearchString, |
Gets index of name in enum, returns INDEX_NONE and optionally errors when name is not found. | UObject/Class.h | |
int32 GetIndexByValue
(
int64 InValue |
Index is the internal index into the Enum array, and is not useful outside of the Enum system Value is the value set in the Enum Class in C++ or Blueprint Enums can be sparse, which means that not every valid Index is a proper Value, and they are not necessarily equal It is not safe to cast an Index to a Enum Class, always do that with a Value instead Gets the internal index for an enum value. | UObject/Class.h | |
int64 GetMaxEnumValue () |
Gets max value of Enum. Defaults to zero if there are no entries. | UObject/Class.h | |
FString GetMetaData
(
const TCHAR* Key, |
Return the metadata value associated with the specified key. | UObject/Class.h | |
FName GetNameByIndex
(
int32 Index |
Gets enum name by index in Names array. Returns NAME_None if Index is not valid. | UObject/Class.h | |
FName GetNameByValue
(
int64 InValue |
Gets enum name by value. Returns NAME_None if value is not found. | UObject/Class.h | |
FString GetNameStringByIndex
(
int32 InIndex |
Returns the short name at the enum index, returns empty string if invalid | UObject/Class.h | |
FString GetNameStringByValue
(
int64 InValue |
Returns the short name matching the enum Value, returns empty string if invalid | UObject/Class.h | |
FText GetToolTipTextByIndex
(
int32 NameIndex |
Finds the localized tooltip or native tooltip as a fallback. | UObject/Class.h | |
int64 GetValueByIndex
(
int32 Index |
Gets enum value by index in Names array. Asserts on invalid index | UObject/Class.h | |
int64 GetValueByName
(
FName InName, |
Gets enum value by name, returns INDEX_NONE and optionally errors when name is not found. | UObject/Class.h | |
int64 GetValueByNameString
(
const FString& SearchString, |
Gets enum value by name, returns INDEX_NONE and optionally errors when name is not found. | UObject/Class.h | |
FString GetValueOrBitfieldAsAuthoredNameString
(
int64 InValue |
If the enumeration is declared as UENUM(Flags), returns a string of the form A | B | C representing set bits A, B, and C. | UObject/Class.h | |
FText GetValueOrBitfieldAsDisplayNameText
(
int64 InValue |
If the enumeration is declared as UENUM(Flags), returns a string of the form A | B | C representing set bits A, B, and C. | UObject/Class.h | |
FString GetValueOrBitfieldAsString
(
int64 InValue |
If the enumeration is declared as UENUM(Flags), returns a string of the form A | B | C representing set bits A, B, and C. | UObject/Class.h | |
int64 GetValueOrBitfieldFromString
(
FStringView InString, |
Gets enum value by name, returns INDEX_NONE and optionally errors when name is not found. | UObject/Class.h | |
bool HasAnyEnumFlags
(
EEnumFlags InFlags |
UObject/Class.h | ||
bool HasMetaData
(
const TCHAR* Key, |
Wrapper method for easily determining whether this enum has metadata associated with it. | UObject/Class.h | |
bool IsValidEnumName
(
FName InName |
Checks if enum has entry with given name. Includes autogenerated _MAX entry. | UObject/Class.h | |
bool IsValidEnumValue
(
int64 InValue |
Checks if enum has entry with given value. Includes autogenerated _MAX entry. | UObject/Class.h | |
bool IsValidEnumValueOrBitfield
(
int64 InValue |
Checks if enum has entry with given value, or combination of flag values. | UObject/Class.h | |
int32 NumEnums() |
UObject/Class.h | ||
void RemoveMetaData
(
const TCHAR* Key, |
Remove given key meta data | UObject/Class.h | |
void RemoveNamesFromMasterList() |
Removes the Names in this enum from the primary AllEnumNames list | UObject/Class.h | |
void RemoveNamesFromPrimaryList() |
Removes the Names in this enum from the primary AllEnumNames list | UObject/Class.h | |
virtual int64 ResolveEnumerator
(
FArchive& Ar, |
Try to update an out-of-date enum index after an enum changes at runtime | UObject/Class.h | |
void SetEnumDisplayNameFn
(
FEnumDisplayNameFn InEnumDisplayNameFn |
Associate a function for looking up Enum display names by index, only intended for use by generated code | UObject/Class.h | |
void SetEnumFlags
(
EEnumFlags FlagsToSet |
UObject/Class.h | ||
virtual bool SetEnums
(
TArray< TPair< FName, int64 > >& InNames, |
Sets the array of enums. | UObject/Class.h | |
void SetMetaData
(
const TCHAR* Key, |
Set the metadata value associated with the specified key. | UObject/Class.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void BeginDestroy () |
Called before destroying the object. | UObject/Class.h | |
| Handles reading, writing, and reference collecting using FArchive. | UObject/Class.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddNamesToMasterList() |
Adds the Names in this enum to the primary AllEnumNames list | UObject/Class.h | |
void AddNamesToPrimaryList() |
Adds the Names in this enum to the primary AllEnumNames list | UObject/Class.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static int64 CalculateMaxEnumValue
(
std::initializer_list< int64 > Values, |
Helper function for UHT - calculate max enum value when UHT was not able to parse all enum values. | UObject/Class.h | |
static FString GenerateEnumPrefix
(
const TArray< TPair< FName, int64 > >& InNames, |
Find the longest common prefix of all enum names in the provided list. | UObject/Class.h | |
static FText GetDisplayValueAsText
(
const EnumType EnumeratorValue |
UObject/Class.h | ||
static FText GetDisplayValueAsText
(
const TEnumAsByte< EnumType > EnumeratorValue |
UObject/Class.h | ||
static FText GetDisplayValueAsText
(
const TCHAR* EnumPath, |
UObject/Class.h | ||
static FText GetDisplayValueAsText
(
const TCHAR* EnumPath, |
UObject/Class.h | ||
static void GetDisplayValueAsText
(
const EnumType EnumeratorValue, |
UObject/Class.h | ||
static void GetDisplayValueAsText
(
const TCHAR* EnumPath, |
UObject/Class.h | ||
static FText GetDisplayValueAsText_Internal
(
const TCHAR* EnumPath, |
UObject/Class.h | ||
static int64 GetMaxEnumValue
(
const TArray< TPair< FName, int64 > >& InNames, |
Gets max value of Enum. | UObject/Class.h | |
static FName GetValueAsName
(
const TEnumAsByte< EnumType > EnumeratorValue |
UObject/Class.h | ||
static void GetValueAsName
(
const EnumType EnumeratorValue, |
UObject/Class.h | ||
static FName GetValueAsName
(
const EnumType EnumeratorValue |
UObject/Class.h | ||
static FString GetValueAsString
(
const EnumType EnumeratorValue |
UObject/Class.h | ||
static FString GetValueAsString
(
const TEnumAsByte< EnumType > EnumeratorValue |
UObject/Class.h | ||
static void GetValueAsString
(
const EnumType EnumeratorValue, |
UObject/Class.h | ||
static void GetValueAsString
(
const TCHAR* EnumPath, |
UObject/Class.h | ||
static FString GetValueAsString
(
const TCHAR* EnumPath, |
UObject/Class.h | ||
static FString GetValueAsString
(
const TCHAR* EnumPath, |
UObject/Class.h | ||
static FString GetValueAsString_Internal
(
const TCHAR* EnumPath, |
UObject/Class.h | ||
static void GetValueOrBitfieldAsString
(
const TCHAR* EnumPath, |
UObject/Class.h | ||
static void GetValueOrBitfieldAsString
(
const IntegralType EnumeratorValue, |
UObject/Class.h | ||
static FString GetValueOrBitfieldAsString
(
const EnumType EnumeratorValue |
UObject/Class.h | ||
static FString GetValueOrBitfieldAsString
(
const TEnumAsByte< EnumType > EnumeratorValue |
TEnumAsByte produces a warning if you use it with EnumClass, so this UE_REQUIRES keeps this overload from being matched in that case | UObject/Class.h | |
static FString GetValueOrBitfieldAsString
(
const IntegralType EnumeratorValue |
UObject/Class.h | ||
static FString GetValueOrBitfieldAsString
(
const TCHAR* EnumPath, |
UObject/Class.h | ||
static FString GetValueOrBitfieldAsString
(
const TCHAR* EnumPath, |
UObject/Class.h | ||
static void GetValueOrBitfieldAsString
(
const EnumType EnumeratorValue, |
UObject/Class.h | ||
static FString GetValueOrBitfieldAsString_Internal
(
const TCHAR* EnumPath, |
UObject/Class.h | ||
static bool IsFullEnumName
(
const TCHAR* InEnumName |
Checks if a enum name is fully qualified name. | UObject/Class.h | |
static UEnum * LookupAllEnumNamesWithOptions
(
FName PackageName, |
Searches the list of all enum value names and returns a UEnum object that contains an enum value name matching the provided comparison function criteria | UObject/Class.h | |
static int64 LookupEnumName
(
FName PackageName, |
Searches the list of all enum value names for the specified name | UObject/Class.h | |
static int64 LookupEnumName
(
FName TestName, |
Searches the list of all enum value names for the specified name | UObject/Class.h | |
static int64 LookupEnumNameSlow
(
FName PackageName, |
Searches the list of all enum value names for the specified name | UObject/Class.h | |
static int64 LookupEnumNameSlow
(
const TCHAR* InTestShortName, |
Searches the list of all enum value names for the specified name | UObject/Class.h | |
static int64 ParseEnum
(
const TCHAR*& Str |
Parses the passed in string for a name, then searches for that name in any Enum (in any package) | UObject/Class.h |