UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FName Class Reference

#include <NameTypes.h>

Public Types

using IntrusiveUnsetOptionalStateType = FName
 

Public Member Functions

FORCEINLINE FNameEntryId GetComparisonIndex () const
 
FORCEINLINE FNameEntryId GetDisplayIndex () const
 
FORCEINLINE int32 GetNumber () const
 
FORCEINLINE void SetNumber (const int32 NewNumber)
 
CORE_API FString GetPlainNameString () const
 
CORE_API uint32 GetPlainNameString (TCHAR(&OutName)[NAME_SIZE]) const
 
CORE_API void GetPlainANSIString (ANSICHAR(&AnsiName)[NAME_SIZE]) const
 
CORE_API void GetPlainWIDEString (WIDECHAR(&WideName)[NAME_SIZE]) const
 
CORE_API const FNameEntryGetComparisonNameEntry () const
 
CORE_API const FNameEntryGetDisplayNameEntry () const
 
CORE_API FString ToString () const
 
CORE_API FUtf8String ToUtf8String () const
 
CORE_API void ToString (FWideString &Out) const
 
CORE_API void ToString (FUtf8String &Out) const
 
CORE_API void ToString (FWideStringBuilderBase &Out) const
 
CORE_API void ToString (FUtf8StringBuilderBase &Out) const
 
CORE_API uint32 GetStringLength () const
 
 UE_DEPRECATED (5.6, "FName::ToString(TCHAR* Out, uint32 OutSize) is dangerous and can lead to buffer overflow if the provided " "buffer is smaller than FName::StringBufferSize, even if the OutSize parameter indicates the buffer is " "smaller than this value. Use the templated ToString() or ToStringTruncate() functions to format the name " "string into a pre-allocated array, or use the allocating ToString() functions that return an FString.") uint32 ToString(TCHAR *Out
 
template<uint32 N>
uint32 ToString (TCHAR(&Out)[N]) const
 
uint32 ToStringTruncate (TCHAR *Out, uint32 OutSize) const
 
template<uint32 N>
uint32 ToStringTruncate (TCHAR(&Out)[N]) const
 
CORE_API void AppendString (FWideString &Out) const
 
CORE_API void AppendString (FUtf8String &Out) const
 
CORE_API void AppendString (FWideStringBuilderBase &Out) const
 
CORE_API void AppendString (FUtf8StringBuilderBase &Out) const
 
CORE_API bool TryAppendAnsiString (FAnsiStringBuilderBase &Out) const
 
FORCEINLINE bool IsEqual (const FName &Other, const ENameCase CompareMethod=ENameCase::IgnoreCase, const bool bCompareNumber=true) const
 
FORCEINLINE bool UEOpEquals (FName Other) const
 
bool UEOpEquals (FIntrusiveUnsetOptionalState I) const
 
FORCEINLINE bool FastLess (const FName &Other) const
 
FORCEINLINE bool LexicalLess (const FName &Other) const
 
FORCEINLINE bool IsNone () const
 
bool IsValid () const
 
bool IsValidIndexFast () const
 
bool IsValidXName (const FString &InInvalidChars, FText *OutReason=nullptr, const FText *InErrorCtx=nullptr) const
 
CORE_API bool IsValidXName () const
 
bool IsValidXName (FText &OutReason, const FString &InInvalidChars) const
 
CORE_API bool IsValidXName (FText &OutReason) const
 
CORE_API bool IsValidObjectName (FText &OutReason) const
 
CORE_API bool IsValidGroupName (FText &OutReason, bool bIsGroupName=false) const
 
CORE_API int32 Compare (const FName &Other) const
 
FORCEINLINE int32 CompareIndexes (const FName &Other) const
 
FORCEINLINE FName (EName Ename)
 
FORCEINLINE FName (EName Ename, int32 InNumber)
 
FORCEINLINE FName (FName Other, int32 InNumber)
 
FORCEINLINE FName (FNameEntryId InComparisonIndex, FNameEntryId InDisplayIndex, int32 InNumber)
 
FORCEINLINE constexpr FName ()
 
constexpr FName (ENoInit)
 
 FName (FIntrusiveUnsetOptionalState I)
 
FORCEINLINE FName (FMinimalName InName)
 
FORCEINLINE FName (FScriptName InName)
 
FORCEINLINE FName (FMemoryImageName InName)
 
CORE_API FName (const WIDECHAR *Name)
 
CORE_API FName (const ANSICHAR *Name)
 
CORE_API FName (const UTF8CHAR *Name)
 
CORE_API FName (const WIDECHAR *Name, EFindName FindType)
 
CORE_API FName (const ANSICHAR *Name, EFindName FindType)
 
CORE_API FName (const UTF8CHAR *Name, EFindName FindType)
 
CORE_API FName (int32 Len, const WIDECHAR *Name, EFindName FindType=FNAME_Add)
 
CORE_API FName (int32 Len, const ANSICHAR *Name, EFindName FindType=FNAME_Add)
 
CORE_API FName (int32 Len, const UTF8CHAR *Name, EFindName FindType=FNAME_Add)
 
 FName (TStringView< ANSICHAR > View, EFindName FindType=FNAME_Add)
 
 FName (TStringView< WIDECHAR > View, EFindName FindType=FNAME_Add)
 
 FName (TStringView< UTF8CHAR > View, EFindName FindType=FNAME_Add)
 
CORE_API FName (const WIDECHAR *Name, int32 Number)
 
CORE_API FName (const ANSICHAR *Name, int32 Number)
 
CORE_API FName (const UTF8CHAR *Name, int32 Number)
 
CORE_API FName (int32 Len, const WIDECHAR *Name, int32 Number)
 
CORE_API FName (int32 Len, const ANSICHAR *Name, int32 Number)
 
CORE_API FName (int32 Len, const UTF8CHAR *Name, int32 Number)
 
 FName (TStringView< ANSICHAR > View, int32 InNumber)
 
 FName (TStringView< WIDECHAR > View, int32 InNumber)
 
 FName (TStringView< UTF8CHAR > View, int32 InNumber)
 
CORE_API FName (const TCHAR *Name, int32 InNumber, bool bSplitName)
 
CORE_API FName (const FNameEntrySerialized &LoadedEntry)
 
CORE_API const ENameToEName () const
 
FORCEINLINE uint64 ToUnstableInt () const
 
template<typename T >
FORCEINLINE auto UEOpEquals (T Rhs) const -> decltype(FName::Equals(*this, Rhs))
 
template<typename StringBuilderType >
void AppendStringInternal (StringBuilderType &Out) const
 

Static Public Member Functions

static CORE_API bool IsValidXName (const FName InName, const FString &InInvalidChars, FText *OutReason=nullptr, const FText *InErrorCtx=nullptr)
 
static CORE_API bool IsValidXName (const TCHAR *InName, const FString &InInvalidChars, FText *OutReason=nullptr, const FText *InErrorCtx=nullptr)
 
static CORE_API bool IsValidXName (const FString &InName, const FString &InInvalidChars, FText *OutReason=nullptr, const FText *InErrorCtx=nullptr)
 
static CORE_API bool IsValidXName (const FStringView &InName, const FString &InInvalidChars, FText *OutReason=nullptr, const FText *InErrorCtx=nullptr)
 
static CORE_API FString SanitizeWhitespace (const FString &FNameString)
 
static FNameEntryId GetComparisonIdFromDisplayId (FNameEntryId DisplayId)
 
static FName CreateFromDisplayId (FNameEntryId DisplayId, int32 Number)
 
static CORE_API void DisplayHash (class FOutputDevice &Ar)
 
static CORE_API FString SafeString (FNameEntryId InDisplayIndex, int32 InstanceNumber=NAME_NO_NUMBER_INTERNAL)
 
static CORE_API void Reserve (uint32 NumBytes, uint32 NumNames)
 
static CORE_API int64 GetNameEntryMemorySize ()
 
static CORE_API int64 GetNameEntryMemoryEstimatedAvailable ()
 
static CORE_API int64 GetNameTableMemorySize ()
 
static CORE_API int32 GetNumAnsiNames ()
 
static CORE_API int32 GetNumWideNames ()
 
static CORE_API TArray< const FNameEntry * > DebugDump ()
 
static CORE_API FNameEntry constGetEntry (EName Ename)
 
static CORE_API FNameEntry constGetEntry (FNameEntryId Id)
 
static CORE_API void AutoTest ()
 
static CORE_API FString NameToDisplayString (const FString &InDisplayName, const bool bIsBool)
 
static CORE_API void AddNameToDisplayStringExemption (const FString &InExemption)
 
static CORE_API void RemoveNameToDisplayStringExemption (const FString &InExemption)
 
static CORE_API void TearDown ()
 

Public Attributes

uint32 OutSize const
 

Static Public Attributes

static constexpr bool bHasIntrusiveUnsetOptionalState = true
 
static constexpr uint32 StringBufferSize = NAME_SIZE + 1 + 10
 

Friends

struct FNameHelper
 
const TCHARDebugFName (int32)
 
const TCHARDebugFName (int32, int32)
 
const TCHARDebugFName (FName &)
 
FScriptName NameToScriptName (FName InName)
 
FMinimalName NameToMinimalName (FName InName)
 
FORCEINLINE uint32 GetTypeHash (FName Name)
 

Detailed Description

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)

Examples
/work/Engine/Source/Runtime/UMG/Public/Components/Widget.h.

Member Typedef Documentation

◆ IntrusiveUnsetOptionalStateType

Constructor & Destructor Documentation

◆ FName() [1/33]

FORCEINLINE FName::FName ( EName  Ename)
inline

Create an FName with a hardcoded string index.

Parameters
NThe hardcoded value the string portion of the name will have. The number portion will be NAME_NO_NUMBER

◆ FName() [2/33]

FORCEINLINE FName::FName ( EName  Ename,
int32  InNumber 
)
inline

Create an FName with a hardcoded string index and (instance).

Parameters
NThe hardcoded value the string portion of the name will have
InNumberThe hardcoded value for the number portion of the name

◆ FName() [3/33]

FORCEINLINE FName::FName ( FName  Other,
int32  InNumber 
)
inline

Create an FName from an existing string, but with a different instance.

Parameters
OtherThe FName to take the string values from
InNumberThe hardcoded value for the number portion of the name

◆ FName() [4/33]

FORCEINLINE FName::FName ( FNameEntryId  InComparisonIndex,
FNameEntryId  InDisplayIndex,
int32  InNumber 
)
inline

Create an FName from its component parts Only call this if you really know what you're doing

◆ FName() [5/33]

FORCEINLINE constexpr FName::FName ( )
inlineconstexpr

Default constructor, initialized to None

◆ FName() [6/33]

constexpr FName::FName ( ENoInit  )
inlineexplicitconstexpr

Scary no init constructor, used for something obscure in UObjectBase

◆ FName() [7/33]

FName::FName ( FIntrusiveUnsetOptionalState  I)
inlineexplicit

Special constructor used by TOptional<FName>

◆ FName() [8/33]

FORCEINLINE FName::FName ( FMinimalName  InName)
explicit

◆ FName() [9/33]

FORCEINLINE FName::FName ( FScriptName  InName)
explicit

◆ FName() [10/33]

FORCEINLINE FName::FName ( FMemoryImageName  InName)

◆ FName() [11/33]

FName::FName ( const WIDECHAR Name)

Create an FName. If FindType is FNAME_Find, and the name doesn't already exist, then the name will be NAME_None. The check for existance or not depends on UE_FNAME_OUTLINE_NUMBER. When UE_FNAME_OUTLINE_NUMBER is 0, we only check for the string part. When UE_FNAME_OUTLINE_NUMBER is 1, we check for whole name including the number.

Parameters
NameValue for the string portion of the name
FindTypeAction to take (see EFindName, default is FNAME_Add)

◆ FName() [12/33]

FName::FName ( const ANSICHAR Name)

◆ FName() [13/33]

FName::FName ( const UTF8CHAR Name)

◆ FName() [14/33]

FName::FName ( const WIDECHAR Name,
EFindName  FindType 
)

◆ FName() [15/33]

FName::FName ( const ANSICHAR Name,
EFindName  FindType 
)

◆ FName() [16/33]

FName::FName ( const UTF8CHAR Name,
EFindName  FindType 
)

◆ FName() [17/33]

FName::FName ( int32  Len,
const WIDECHAR Name,
EFindName  FindType = FNAME_Add 
)

Create FName from non-null string with known length

◆ FName() [18/33]

FName::FName ( int32  Len,
const ANSICHAR Name,
EFindName  FindType = FNAME_Add 
)

◆ FName() [19/33]

FName::FName ( int32  Len,
const UTF8CHAR Name,
EFindName  FindType = FNAME_Add 
)

◆ FName() [20/33]

FName::FName ( TStringView< ANSICHAR View,
EFindName  FindType = FNAME_Add 
)
inlineexplicit

◆ FName() [21/33]

FName::FName ( TStringView< WIDECHAR View,
EFindName  FindType = FNAME_Add 
)
inlineexplicit

◆ FName() [22/33]

FName::FName ( TStringView< UTF8CHAR View,
EFindName  FindType = FNAME_Add 
)
inlineexplicit

◆ FName() [23/33]

FName::FName ( const WIDECHAR Name,
int32  Number 
)

Create an FName. Will add the string to the name table if it does not exist. When UE_FNAME_OUTLINE_NUMBER is set, will also add the combination of base string and number to the name table if it doesn't exist.

Parameters
NameValue for the string portion of the name
NumberValue for the number portion of the name

◆ FName() [24/33]

FName::FName ( const ANSICHAR Name,
int32  Number 
)

◆ FName() [25/33]

FName::FName ( const UTF8CHAR Name,
int32  Number 
)

◆ FName() [26/33]

FName::FName ( int32  Len,
const WIDECHAR Name,
int32  Number 
)

◆ FName() [27/33]

FName::FName ( int32  Len,
const ANSICHAR Name,
int32  Number 
)

◆ FName() [28/33]

FName::FName ( int32  Len,
const UTF8CHAR Name,
int32  Number 
)

◆ FName() [29/33]

FName::FName ( TStringView< ANSICHAR View,
int32  InNumber 
)
inline

◆ FName() [30/33]

FName::FName ( TStringView< WIDECHAR View,
int32  InNumber 
)
inline

◆ FName() [31/33]

FName::FName ( TStringView< UTF8CHAR View,
int32  InNumber 
)
inline

◆ FName() [32/33]

FName::FName ( const TCHAR Name,
int32  InNumber,
bool  bSplitName 
)

Create an FName. If FindType is FNAME_Find, and the string part of the name doesn't already exist, then the name will be NAME_None

Parameters
NameValue for the string portion of the name
NumberValue for the number portion of the name
FindTypeAction to take (see EFindName)
bSplitNametrue if the trailing number should be split from the name when Number == NAME_NO_NUMBER_INTERNAL, or false to always use the name as-is

◆ FName() [33/33]

FName::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. Also, this version skips calculating the hashes of the names if possible

Member Function Documentation

◆ AddNameToDisplayStringExemption()

void FName::AddNameToDisplayStringExemption ( const FString &  InExemption)
static

Add/remove an exemption to the formatting applied by NameToDisplayString. Example: exempt the compound word "MetaHuman" to ensure its not reformatted as "Meta Human".

◆ AppendString() [1/4]

void FName::AppendString ( FUtf8String Out) const

◆ AppendString() [2/4]

void FName::AppendString ( FUtf8StringBuilderBase Out) const

◆ AppendString() [3/4]

void FName::AppendString ( FWideString Out) const

Converts an FName to a readable format, in place, appending to an existing string (ala GetFullName)

Parameters
OutString to append with the string representation of the name

◆ AppendString() [4/4]

void FName::AppendString ( FWideStringBuilderBase Out) const

Converts an FName to a readable format, in place, appending to an existing string (ala GetFullName)

Parameters
OutStringBuilder to append with the string representation of the name

◆ AppendStringInternal()

void FName::AppendStringInternal ( StringBuilderType Out) const

◆ AutoTest()

void FName::AutoTest ( )
static

Run autotest on FNames.

◆ Compare()

int32 FName::Compare ( const FName Other) const

Compares name to passed in one. Sort is alphabetical ascending.

Parameters
OtherName to compare this against
Returns
< 0 is this < Other, 0 if this == Other, > 0 if this > Other

◆ CompareIndexes()

FORCEINLINE int32 FName::CompareIndexes ( const FName Other) const
inline

Fast non-alphabetical order that is only stable during this process' lifetime.

Parameters
OtherName to compare this against
Returns
< 0 is this < Other, 0 if this == Other, > 0 if this > Other

◆ CreateFromDisplayId()

static FName FName::CreateFromDisplayId ( FNameEntryId  DisplayId,
int32  Number 
)
inlinestatic

Only call this if you really know what you're doing

◆ DebugDump()

TArray< const FNameEntry * > FName::DebugDump ( )
static

◆ DisplayHash()

void FName::DisplayHash ( class FOutputDevice Ar)
static

◆ FastLess()

FORCEINLINE bool FName::FastLess ( const FName Other) const
inline

Fast non-alphabetical order that is only stable during this process' lifetime.

◆ GetComparisonIdFromDisplayId()

static FNameEntryId FName::GetComparisonIdFromDisplayId ( FNameEntryId  DisplayId)
inlinestatic

◆ GetComparisonIndex()

FORCEINLINE FNameEntryId FName::GetComparisonIndex ( ) const
inline

◆ GetComparisonNameEntry()

const FNameEntry * FName::GetComparisonNameEntry ( ) const

◆ GetDisplayIndex()

FORCEINLINE FNameEntryId FName::GetDisplayIndex ( ) const
inline

◆ GetDisplayNameEntry()

const FNameEntry * FName::GetDisplayNameEntry ( ) const

◆ GetEntry() [1/2]

FNameEntry const * FName::GetEntry ( EName  Ename)
static

◆ GetEntry() [2/2]

FNameEntry const * FName::GetEntry ( FNameEntryId  Id)
static

◆ GetNameEntryMemoryEstimatedAvailable()

int64 FName::GetNameEntryMemoryEstimatedAvailable ( )
static
Returns
Estimated remaining size the name entry table is willing to allocate.

◆ GetNameEntryMemorySize()

int64 FName::GetNameEntryMemorySize ( )
static
Returns
Size of all name entries.

◆ GetNameTableMemorySize()

int64 FName::GetNameTableMemorySize ( )
static
Returns
Size of Name Table object as a whole

◆ GetNumAnsiNames()

int32 FName::GetNumAnsiNames ( )
static
Returns
number of ansi names in name table

◆ GetNumber()

FORCEINLINE int32 FName::GetNumber ( ) const
inline

◆ GetNumWideNames()

int32 FName::GetNumWideNames ( )
static
Returns
number of wide names in name table

◆ GetPlainANSIString()

void FName::GetPlainANSIString ( ANSICHAR(&)  AnsiName[NAME_SIZE]) const

Copy ANSI name without number part. Must only be used for ANSI FNames. Doesn't allocate.

◆ GetPlainNameString() [1/2]

FString FName::GetPlainNameString ( ) const

Get name without number part as a dynamically allocated string

◆ GetPlainNameString() [2/2]

uint32 FName::GetPlainNameString ( TCHAR(&)  OutName[NAME_SIZE]) const

Convert name without number part into TCHAR buffer and returns string length. Doesn't allocate.

◆ GetPlainWIDEString()

void FName::GetPlainWIDEString ( WIDECHAR(&)  WideName[NAME_SIZE]) const

Copy wide name without number part. Must only be used for wide FNames. Doesn't allocate.

◆ GetStringLength()

uint32 FName::GetStringLength ( ) const

Get the number of characters, excluding null-terminator, that ToString() would yield

◆ IsEqual()

FORCEINLINE bool FName::IsEqual ( const FName Other,
const ENameCase  CompareMethod = ENameCase::IgnoreCase,
const bool  bCompareNumber = true 
) const

Check to see if this FName matches the other FName, potentially also checking for any case variations

◆ IsNone()

FORCEINLINE bool FName::IsNone ( ) const
inline

True for FName(), FName(NAME_None) and FName("None")

◆ IsValid()

bool FName::IsValid ( ) const
inline

Paranoid sanity check

All FNames are valid except for stomped memory, dangling pointers, etc. Should only be used to investigate such bugs and not in production code.

◆ IsValidGroupName()

bool FName::IsValidGroupName ( FText OutReason,
bool  bIsGroupName = false 
) const

Takes an FName and checks to see that it follows the rules that Unreal requires for package or group names.

Parameters
OutReasonIf the check fails, this string is filled in with the reason why.
bIsGroupNameif true, check legality for a group name, else check legality for a package name
Returns
true if the name is valid

◆ IsValidIndexFast()

bool FName::IsValidIndexFast ( ) const
inline

Paranoid sanity check, same as IsValid()

◆ IsValidObjectName()

bool FName::IsValidObjectName ( FText OutReason) const

Takes an FName and checks to see that it follows the rules that Unreal requires for object names.

Parameters
OutReasonIf the check fails, this string is filled in with the reason why.
Returns
true if the name is valid

◆ IsValidXName() [1/8]

bool FName::IsValidXName ( ) const

◆ IsValidXName() [2/8]

bool FName::IsValidXName ( const FName  InName,
const FString &  InInvalidChars,
FText OutReason = nullptr,
const FText InErrorCtx = nullptr 
)
static

Checks to see that a given name-like string follows the rules that Unreal requires.

Parameters
InNameString containing the name to test.
InInvalidCharsThe set of invalid characters that the name cannot contain.
OutReasonIf the check fails, this string is filled in with the reason why.
InErrorCtxError context information to show in the error message (default is "Name").
Returns
true if the name is valid

◆ IsValidXName() [3/8]

bool FName::IsValidXName ( const FString &  InInvalidChars,
FText OutReason = nullptr,
const FText InErrorCtx = nullptr 
) const
inline

Checks to see that a FName follows the rules that Unreal requires.

Parameters
InInvalidCharsThe set of invalid characters that the name cannot contain
OutReasonIf the check fails, this string is filled in with the reason why.
InErrorCtxError context information to show in the error message (default is "Name").
Returns
true if the name is valid

◆ IsValidXName() [4/8]

bool FName::IsValidXName ( const FString &  InName,
const FString &  InInvalidChars,
FText OutReason = nullptr,
const FText InErrorCtx = nullptr 
)
static

◆ IsValidXName() [5/8]

bool FName::IsValidXName ( const FStringView InName,
const FString &  InInvalidChars,
FText OutReason = nullptr,
const FText InErrorCtx = nullptr 
)
static

◆ IsValidXName() [6/8]

bool FName::IsValidXName ( const TCHAR InName,
const FString &  InInvalidChars,
FText OutReason = nullptr,
const FText InErrorCtx = nullptr 
)
static

◆ IsValidXName() [7/8]

bool FName::IsValidXName ( FText OutReason) const

◆ IsValidXName() [8/8]

bool FName::IsValidXName ( FText OutReason,
const FString &  InInvalidChars 
) const
inline

Takes an FName and checks to see that it follows the rules that Unreal requires.

Parameters
OutReasonIf the check fails, this string is filled in with the reason why.
InInvalidCharsThe set of invalid characters that the name cannot contain
Returns
true if the name is valid

◆ LexicalLess()

FORCEINLINE bool FName::LexicalLess ( const FName Other) const
inline

Slow alphabetical order that is stable / deterministic over process runs.

◆ NameToDisplayString()

FString FName::NameToDisplayString ( const FString &  InDisplayName,
const bool  bIsBool 
)
static

Takes a string and breaks it down into a human readable string. For example - "bCreateSomeStuff" becomes "Create Some Stuff?" and "DrawScale3D" becomes "Draw Scale 3D".

Parameters
InDisplayName[In, Out] The name to sanitize
bIsBoolTrue if the name is a bool
Returns
the sanitized version of the display name

◆ RemoveNameToDisplayStringExemption()

void FName::RemoveNameToDisplayStringExemption ( const FString &  InExemption)
static

◆ Reserve()

void FName::Reserve ( uint32  NumBytes,
uint32  NumNames 
)
static

◆ SafeString()

FString FName::SafeString ( FNameEntryId  InDisplayIndex,
int32  InstanceNumber = NAME_NO_NUMBER_INTERNAL 
)
static

◆ SanitizeWhitespace()

FString FName::SanitizeWhitespace ( const FString &  FNameString)
static

Printing FNames in logging or on screen can be problematic when they contain Whitespace characters such as
and \r, so this will return an FName based upon the calling FName, but with any Whitespace characters potentially problematic for showing in a log or on screen omitted.

Returns
the new FName based upon the calling FName, but with any Whitespace characters potentially problematic for showing in a log or on screen omitted.

◆ SetNumber()

FORCEINLINE void FName::SetNumber ( const int32  NewNumber)
inline

◆ TearDown()

void FName::TearDown ( )
static

Tear down system and free all allocated memory

FName must not be used after teardown

◆ ToEName()

const EName * FName::ToEName ( ) const

Get the EName that this FName represents or nullptr

◆ ToString() [1/6]

FString FName::ToString ( ) const

Converts an FName to a readable format

Returns
String representation of the name

◆ ToString() [2/6]

void FName::ToString ( FUtf8String Out) const

◆ ToString() [3/6]

void FName::ToString ( FUtf8StringBuilderBase Out) const

◆ ToString() [4/6]

void FName::ToString ( FWideString Out) const

Converts an FName to a readable format, in place

Parameters
OutString to fill with the string representation of the name

◆ ToString() [5/6]

void FName::ToString ( FWideStringBuilderBase Out) const

Converts an FName to a readable format, in place

Parameters
OutStringBuilder to fill with the string representation of the name

◆ ToString() [6/6]

template<uint32 N>
uint32 FName::ToString ( TCHAR(&)  Out[N]) const
inline

Converts the FName to a string buffer, avoiding dynamic allocations.

Returns the length of the string, excluding the null terminator.

Note that a default constructed FName returns "None" instead of ""

◆ ToStringTruncate() [1/2]

uint32 FName::ToStringTruncate ( TCHAR Out,
uint32  OutSize 
) const
inline

Converts the FName to a string buffer, avoiding dynamic allocations. Truncates the name if it does not fit in the specified output buffer. Use a buffer size of at least FName::StringBufferSize to avoid truncation.

Returns the length of the (possibly truncated) string, excluding the null terminator.

Note that a default constructed FName returns "None" instead of ""

◆ ToStringTruncate() [2/2]

template<uint32 N>
uint32 FName::ToStringTruncate ( TCHAR(&)  Out[N]) const
inline

◆ ToUnstableInt()

FORCEINLINE uint64 FName::ToUnstableInt ( ) const
inline

Returns an integer that compares equal in the same way FNames do, only usable within the current process

◆ ToUtf8String()

FUtf8String FName::ToUtf8String ( ) const

Converts an FName to a readable format

Returns
String representation of the name

◆ TryAppendAnsiString()

bool FName::TryAppendAnsiString ( FAnsiStringBuilderBase Out) const

Converts an ANSI FName to a readable format appended to the string builder.

Parameters
OutA string builder to write the readable representation of the name into.
Returns
Whether the string is ANSI. A return of false indicates that the string was wide and was not written.

◆ UE_DEPRECATED()

FName::UE_DEPRECATED ( 5.  6,
"FName::ToString(TCHAR* Out, uint32 OutSize) is dangerous and can lead to buffer overflow if the provided " "buffer is smaller than FName::StringBufferSize  ,
even if the OutSize parameter indicates the buffer is " "smaller than this value. Use the templated ToString() or ToStringTruncate() functions to format the name " "string into a pre-allocated  array,
or use the allocating ToString() functions that return an FString."   
)

Convert to string buffer to avoid dynamic allocations and returns string length

Fails hard if OutLen < GetStringLength() + 1. StringBufferSize guarantees success.

Note that a default constructed FName returns "None" instead of ""

◆ UEOpEquals() [1/3]

bool FName::UEOpEquals ( FIntrusiveUnsetOptionalState  I) const
inline

Special comparison operator for TOptional<FName>::IsSet

◆ UEOpEquals() [2/3]

FORCEINLINE bool FName::UEOpEquals ( FName  Other) const
inline

◆ UEOpEquals() [3/3]

template<typename T >
FORCEINLINE auto FName::UEOpEquals ( Rhs) const -> decltype(FName::Equals(*this, Rhs))
inline

Friends And Related Symbol Documentation

◆ DebugFName [1/3]

const TCHAR * DebugFName ( FName Name)
friend

Helper function that can be used inside the debuggers watch window. E.g. "DebugFName(Class->Name)".

Parameters
NameName to look up string for
Returns
Associated name

◆ DebugFName [2/3]

const TCHAR * DebugFName ( int32  )
friend

◆ DebugFName [3/3]

const TCHAR * DebugFName ( int32  Index,
int32  Number 
)
friend

Helper function that can be used inside the debuggers watch window. E.g. "DebugFName(Class->Name.Index, Class->Name.Number)".

Parameters
IndexName index to look up string for
NumberInternal instance number of the FName to print (which is 1 more than the printed number)
Returns
Associated name

◆ FNameHelper

◆ GetTypeHash

FORCEINLINE uint32 GetTypeHash ( FName  Name)
friend

◆ NameToMinimalName

FMinimalName NameToMinimalName ( FName  InName)
friend

◆ NameToScriptName

FScriptName NameToScriptName ( FName  InName)
friend

Member Data Documentation

◆ bHasIntrusiveUnsetOptionalState

constexpr bool FName::bHasIntrusiveUnsetOptionalState = true
staticconstexpr

◆ const

uint32 OutSize FName::const
Initial value:
{
return ToStringInternal(Out, StringBufferSize)
static constexpr uint32 StringBufferSize
Definition NameTypes.h:708

◆ StringBufferSize

constexpr uint32 FName::StringBufferSize = NAME_SIZE + 1 + 10
inlinestaticconstexpr

Buffer size required for any null-terminated FName string, i.e. [name] '_' [digits] '\0'


The documentation for this class was generated from the following files: