Navigation
API > API/Runtime > API/Runtime/Core
Public name, available to the world. Names are stored as a combination of an index into a table of unique strings and an instance number. Names are case-insensitive, but case-preserving (when WITH_CASE_PRESERVING_NAME is 1)
| Name | FName |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/UObject/NameTypes.h |
| Include Path | #include "UObject/NameTypes.h" |
Syntax
class FName
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| UObject/NameTypes.h | |||
| UObject/NameTypes.h | |||
| Create an FName from an existing string, but with a different instance. | UObject/NameTypes.h | ||
| Create an FName with a hardcoded string index and (instance). | UObject/NameTypes.h | ||
FName
(
const WIDECHAR* Name |
Create an FName. | UObject/NameTypes.h | |
FName
(
const UTF8CHAR* Name |
UObject/NameTypes.h | ||
FName
(
FMemoryImageName InName |
UObject/NameTypes.h | ||
constexpr FName () |
Default constructor, initialized to None | UObject/NameTypes.h | |
| Create an FName with a hardcoded string index. | UObject/NameTypes.h | ||
| Scary no init constructor, used for something obscure in UObjectBase | UObject/NameTypes.h | ||
| Special constructor used by TOptional |
UObject/NameTypes.h | ||
FName
(
FMinimalName InName |
UObject/NameTypes.h | ||
FName
(
FScriptName InName |
UObject/NameTypes.h | ||
| UObject/NameTypes.h | |||
FName
(
TStringView< ANSICHAR > View, |
UObject/NameTypes.h | ||
FName
(
const FNameEntrySerialized& LoadedEntry |
Constructor used by FLinkerLoad when loading its name table; Creates an FName with an instance number of 0 that does not attempt to split the FName into string and number portions. | UObject/NameTypes.h | |
FName
(
TStringView< UTF8CHAR > View, |
UObject/NameTypes.h | ||
FName
(
const TCHAR* Name, |
Create an FName. | UObject/NameTypes.h | |
FName
(
int32 Len, |
UObject/NameTypes.h | ||
FName
(
int32 Len, |
UObject/NameTypes.h | ||
FName
(
int32 Len, |
UObject/NameTypes.h | ||
| UObject/NameTypes.h | |||
| UObject/NameTypes.h | |||
| Create FName from non-null string with known length | UObject/NameTypes.h | ||
FName
(
FNameEntryId InComparisonIndex, |
Create an FName from its component parts Only call this if you really know what you're doing | UObject/NameTypes.h | |
FName
(
TStringView< WIDECHAR > View, |
UObject/NameTypes.h | ||
FName
(
const ANSICHAR* Name |
UObject/NameTypes.h | ||
FName
(
const WIDECHAR* Name, |
Create an FName. | UObject/NameTypes.h | |
FName
(
const ANSICHAR* Name, |
UObject/NameTypes.h | ||
FName
(
const UTF8CHAR* Name, |
UObject/NameTypes.h | ||
FName
(
TStringView< UTF8CHAR > View, |
UObject/NameTypes.h | ||
FName
(
TStringView< WIDECHAR > View, |
UObject/NameTypes.h | ||
FName
(
TStringView< ANSICHAR > View, |
UObject/NameTypes.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| IntrusiveUnsetOptionalStateType | FName | UObject/NameTypes.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| bHasIntrusiveUnsetOptionalState | bool | UObject/NameTypes.h | |
| StringBufferSize | uint32 | Buffer size required for any null-terminated FName string, i.e. [name] '_' [digits] '\0' | UObject/NameTypes.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ComparisonIndex | FNameEntryId | Index into the Names array (used to find String portion of the string/number pair used for comparison) | UObject/NameTypes.h | |
| DisplayIndex | FNameEntryId | Index into the Names array (used to find String portion of the string/number pair used for display) | UObject/NameTypes.h | |
| Number | uint32 | Number portion of the string/number pair (stored internally as 1 more than actual, so zero'd memory will be the default, no-instance case) | UObject/NameTypes.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AppendString
(
FWideStringBuilderBase& Out |
Converts an FName to a readable format, in place, appending to an existing string (ala GetFullName) | UObject/NameTypes.h | |
void AppendString
(
FUtf8StringBuilderBase& Out |
UObject/NameTypes.h | ||
void AppendString
(
FUtf8String& Out |
UObject/NameTypes.h | ||
void AppendString
(
FWideString& Out |
Converts an FName to a readable format, in place, appending to an existing string (ala GetFullName) | UObject/NameTypes.h | |
void AppendStringInternal
(
StringBuilderType& Out |
|||
int32 Compare
(
const FName& Other |
Compares name to passed in one. Sort is alphabetical ascending. | UObject/NameTypes.h | |
int32 CompareIndexes
(
const FName& Other |
Fast non-alphabetical order that is only stable during this process' lifetime. | UObject/NameTypes.h | |
bool FastLess
(
const FName& Other |
Fast non-alphabetical order that is only stable during this process' lifetime. | UObject/NameTypes.h | |
FNameEntryId GetComparisonIndex() |
UObject/NameTypes.h | ||
const FNameEntry * GetComparisonNameEntry() |
UObject/NameTypes.h | ||
FNameEntryId GetDisplayIndex() |
UObject/NameTypes.h | ||
const FNameEntry * GetDisplayNameEntry() |
UObject/NameTypes.h | ||
int32 GetNumber() |
UObject/NameTypes.h | ||
void GetPlainANSIString
(
ANSICHAR(&) AnsiName |
Copy ANSI name without number part. Must only be used for ANSI FNames. Doesn't allocate. | UObject/NameTypes.h | |
uint32 GetPlainNameString
(
TCHAR(&) OutName |
Convert name without number part into TCHAR buffer and returns string length. Doesn't allocate. | UObject/NameTypes.h | |
| Get name without number part as a dynamically allocated string | UObject/NameTypes.h | ||
void GetPlainWIDEString
(
WIDECHAR(&) WideName |
Copy wide name without number part. Must only be used for wide FNames. Doesn't allocate. | UObject/NameTypes.h | |
uint32 GetStringLength() |
Get the number of characters, excluding null-terminator, that ToString() would yield | UObject/NameTypes.h | |
| Check to see if this FName matches the other FName, potentially also checking for any case variations | UObject/NameTypes.h | ||
bool IsNone() |
True for FName(), FName(NAME_None) and FName("None") | UObject/NameTypes.h | |
bool IsValid () |
Paranoid sanity check | UObject/NameTypes.h | |
bool IsValidGroupName
(
FText& OutReason, |
Takes an FName and checks to see that it follows the rules that Unreal requires for package or group names. | UObject/NameTypes.h | |
bool IsValidIndexFast() |
Paranoid sanity check, same as IsValid() | UObject/NameTypes.h | |
bool IsValidObjectName
(
FText& OutReason |
Takes an FName and checks to see that it follows the rules that Unreal requires for object names. | UObject/NameTypes.h | |
bool IsValidXName
(
FText& OutReason, |
Takes an FName and checks to see that it follows the rules that Unreal requires. | UObject/NameTypes.h | |
bool IsValidXName
(
FText& OutReason |
UObject/NameTypes.h | ||
bool IsValidXName () |
UObject/NameTypes.h | ||
bool IsValidXName
(
const FString& InInvalidChars, |
Checks to see that a FName follows the rules that Unreal requires. | UObject/NameTypes.h | |
bool LexicalLess
(
const FName& Other |
Slow alphabetical order that is stable / deterministic over process runs. | UObject/NameTypes.h | |
void SetNumber
(
const int32 NewNumber |
UObject/NameTypes.h | ||
const EName * ToEName() |
Get the EName that this FName represents or nullptr | UObject/NameTypes.h | |
| Converts an FName to a readable format | UObject/NameTypes.h | ||
uint32 ToString
(
TCHAR* Out, |
Convert to string buffer to avoid dynamic allocations and returns string length | UObject/NameTypes.h | |
void ToString
(
FUtf8StringBuilderBase& Out |
UObject/NameTypes.h | ||
uint32 ToString
(
TCHAR(&) Out |
Converts the FName to a string buffer, avoiding dynamic allocations. | UObject/NameTypes.h | |
void ToString
(
FWideString& Out |
Converts an FName to a readable format, in place | UObject/NameTypes.h | |
void ToString
(
FWideStringBuilderBase& Out |
Converts an FName to a readable format, in place | UObject/NameTypes.h | |
void ToString
(
FUtf8String& Out |
UObject/NameTypes.h | ||
uint32 ToStringTruncate
(
TCHAR* Out, |
Converts the FName to a string buffer, avoiding dynamic allocations. | UObject/NameTypes.h | |
uint32 ToStringTruncate
(
TCHAR(&) Out |
UObject/NameTypes.h | ||
uint64 ToUnstableInt() |
Returns an integer that compares equal in the same way FNames do, only usable within the current process | UObject/NameTypes.h | |
FUtf8String ToUtf8String() |
Converts an FName to a readable format | UObject/NameTypes.h | |
bool TryAppendAnsiString
(
FAnsiStringBuilderBase& Out |
Converts an ANSI FName to a readable format appended to the string builder. | UObject/NameTypes.h | |
bool UEOpEquals
(
FName Other |
UObject/NameTypes.h | ||
bool UEOpEquals
(
FIntrusiveUnsetOptionalState I |
Special comparison operator for TOptional |
UObject/NameTypes.h | |
decltype(FName::Equals(*this, Rhs)) UEOpEquals
(
T Rhs |
UObject/NameTypes.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void AddNameToDisplayStringExemption
(
const FString& InExemption |
Add/remove an exemption to the formatting applied by NameToDisplayString. | UObject/NameTypes.h | |
static void AutoTest() |
Run autotest on FNames. | UObject/NameTypes.h | |
static FName CreateFromDisplayId
(
FNameEntryId DisplayId, |
Only call this if you really know what you're doing | UObject/NameTypes.h | |
static FName CreateNumberedNameIfNecessary
(
FNameEntryId ComparisonId, |
UObject/NameTypes.h | ||
static FName CreateNumberedNameIfNecessary
(
FNameEntryId ComparisonId, |
These FNameEntryIds are passed in from user code so they must be non-numbered if Number != NAME_NO_NUMBER_INTERNAL. | UObject/NameTypes.h | |
static TArray< const FNameEntry * > DebugDump() |
UObject/NameTypes.h | ||
static void DisplayHash
(
FOutputDevice& Ar |
UObject/NameTypes.h | ||
| UObject/NameTypes.h | |||
| UObject/NameTypes.h | |||
| UObject/NameTypes.h | |||
static bool Equals
(
FName A, |
UObject/NameTypes.h | ||
static bool Equals
(
FName A, |
UObject/NameTypes.h | ||
static bool Equals
(
FName A, |
UObject/NameTypes.h | ||
| UObject/NameTypes.h | |||
| UObject/NameTypes.h | |||
| UObject/NameTypes.h | |||
static FNameEntryId GetComparisonIdFromDisplayId
(
FNameEntryId DisplayId |
UObject/NameTypes.h | ||
static FNameEntry const * GetEntry
(
EName Ename |
UObject/NameTypes.h | ||
static FNameEntry const * GetEntry
(
FNameEntryId Id |
UObject/NameTypes.h | ||
static int64 GetNameEntryMemoryEstimatedAvailable() |
UObject/NameTypes.h | ||
static int64 GetNameEntryMemorySize() |
UObject/NameTypes.h | ||
static int64 GetNameTableMemorySize() |
UObject/NameTypes.h | ||
static int32 GetNumAnsiNames() |
UObject/NameTypes.h | ||
static int32 GetNumWideNames() |
UObject/NameTypes.h | ||
static bool IsValidXName
(
const TCHAR* InName, |
UObject/NameTypes.h | ||
static bool IsValidXName
(
const FString& InName, |
UObject/NameTypes.h | ||
static bool IsValidXName
(
const FStringView& InName, |
UObject/NameTypes.h | ||
static bool IsValidXName
(
const FName InName, |
Checks to see that a given name-like string follows the rules that Unreal requires. | UObject/NameTypes.h | |
static bool IsWithinBounds
(
FNameEntryId Id |
UObject/NameTypes.h | ||
static FString NameToDisplayString
(
const FString& InDisplayName, |
Takes a string and breaks it down into a human readable string. | UObject/NameTypes.h | |
static void RemoveNameToDisplayStringExemption
(
const FString& InExemption |
UObject/NameTypes.h | ||
static void Reserve
(
uint32 NumBytes, |
UObject/NameTypes.h | ||
static const FNameEntry * ResolveEntry
(
FNameEntryId LookupId |
Resolve the entry directly referred to by LookupId. | UObject/NameTypes.h | |
static const FNameEntry * ResolveEntryRecursive
(
FNameEntryId LookupId |
Recursively resolve through the entry referred to by LookupId to reach the allocated string entry, in the case of UE_FNAME_OUTLINE_NUMBER=1. | UObject/NameTypes.h | |
static FString SafeString
(
FNameEntryId InDisplayIndex, |
UObject/NameTypes.h | ||
static FString SanitizeWhitespace
(
const FString& FNameString |
Printing FNames in logging or on screen can be problematic when they contain Whitespace characters such as | UObject/NameTypes.h | |
static void TearDown () |
Tear down system and free all allocated memory | UObject/NameTypes.h |