Language:
Discover
By Skill Level
By Category

FName

Choose your OS:

Syntax

class FName

Remarks

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)

Variables

Name Description

Public variable

NAME_INDEX

 

ComparisonIndex

Index into the Names array (used to find String portion of the string/number pair used for comparison)

Public variable

NAME_INDEX

 

DisplayIndex

Index into the Names array (used to find String portion of the string/number pair used for display)

Public variable

uint32

 

Number

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)

Constructors

Name Description

Public function

FName()

Default constructor, initialized to None

Public function

FName

(
    const NAME_INDEX InComparisonIndex,
    const NAME_INDEX InDisplayIndex,
    const int32 InNumber
)

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

Public function

FName

(
    const WIDECHAR * Name,
    EFindName FindType,
    bool bUnused
)

Deprecated bUnused.

Public function

FName

(
    const ANSICHAR * Name,
    EFindName FindType,
    bool bUnused
)

Public function

FName

(
    const TCHAR * Name,
    int32 InNumber,
    EFindName FindType
)

Create an FName .

Public function

FName

(
    EName N
)

Create an FName with a hardcoded string index.

Public function

FName

(
    ENoInit
)

Scary no init constructor, used for something obscure in UObjectBase

Public function

FName

(
    const FNameEntrySerialized & Loaded...
)

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.

Public function

FName

(
    EName N,
    int32 InNumber
)

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

Public function

FName

(
    const FName & Other,
    int32 InNumber
)

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

Public function

FName

(
    const WIDECHAR * Name,
    EFindName FindType
)

Create an FName .

Public function

FName

(
    const ANSICHAR * Name,
    EFindName FindType
)

Public function

FName

(
    EName HardcodedIndex,
    const TCHAR * Name
)

Create an FName with a hardcoded string index.

Functions

Name Description

Public function

void

 

AppendString

(
    FString & Out
)

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

Public function Static

void

 

AutoTest()

Run autotest on FNames.

Public function

int32

 

Compare

(
    const FName & Other
)

Compares name to passed in one.

Public function

int32

 

CompareIndexes

(
    const FName & Other
)

Fast compares name to passed in one using indexes.

Public function Static

void

 

DisplayHash

(
    FOutputDevice & Ar
)

Public function Static

uint16

 

GetCasePreservingHash

(
    const TCharType* Source
)

Public function

NAME_INDEX

 

GetComparisonIndex()

Public function

const FNameE ...

 

GetComparisonNameEntry()

Public function

NAME_INDEX

 

GetDisplayIndex()

Public function

const FNameE ...

 

GetDisplayNameEntry()

Public function Static

FNameEntry c...

 

GetEntry

(
    int i
)

Public function Static

int32

 

GetMaxNames()

Public function Static

int32

 

GetNameEntryMemorySize()

Size of all name entries.

Public function Static

FNameEntry &...

 

GetNameTableForDebuggerVisualizers_MT()

Singleton to retrieve a table of all names (multithreaded) for debug visualizers.

Public function Static

int32

 

GetNameTableMemorySize()

Size of Name Table object as a whole

Public function Static

uint16

 

GetNonCasePreservingHash

(
    const TCharType* Source
)

Public function Static

int32

 

GetNumAnsiNames()

Number of ansi names in name table

Public function

int32

 

GetNumber()

Public function Static

int32

 

GetNumWideNames()

Number of wide names in name table

Public function

ANSICHAR con...

 

GetPlainANSIString()

Returns the underlying ANSI string pointer.

Public function

FString

 

GetPlainNameString()

Returns the pure name string without any trailing numbers

Public function

WIDECHAR con...

 

GetPlainWIDEString()

Returns the underlying WIDE string pointer.

Public function

bool

 

IsEqual

(
    const FName & Other,
    const ENameCase CompareMethod,
    const bool bCompareNumber
)

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

Public function

bool

 

IsNone()

Public function

bool

 

IsValid()

Public function

bool

 

IsValidGroupName

(
    FText & OutReason,
    bool bIsGroupName
)

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

Public function

bool

 

IsValidIndexFast()

Helper function to check if the index is valid. Does not check if the name itself is valid.

Public function

bool

 

IsValidObjectName

(
    FText & OutReason
)

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

Public function Static

bool

 

IsValidXName

(
    const FString & InName,
    const FString & InInvalidChars,
    FText * OutReason,
    const FText * InErrorCtx
)

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

Public function

bool

 

IsValidXName

(
    const FString & InInvalidChars,
    FText * OutReason,
    const FText * InErrorCtx
)

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

Public function

bool

 

IsValidXName

(
    FText & OutReason,
    const FString & InInvalidChars
)

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

Public function Static

FString

 

NameToDisplayString

(
    const FString & InDisplayName,
    const bool bIsBool
)

Takes a string and breaks it down into a human readable string.

Public function Static

FString

 

SafeString

(
    int32 InDisplayIndex,
    int32 InstanceNumber
)

Public function

void

 

SetNumber

(
    const int32 NewNumber
)

Public function Static

bool

 

SplitNameWithCheck

(
    const WIDECHAR * OldName,
    WIDECHAR * NewName,
    int32 NewNameLen,
    int32 & NewNumber
)

Helper function to split an old-style name (Class_Number, ie Rocket_17) into the component parts usable by new-style FNames.

Public function Static

void

 

StaticInit()

FName subsystem.

Public function

FString

 

ToString()

Converts an FName to a readable format

Public function

void

 

ToString

(
    FString & Out
)

Converts an FName to a readable format, in place

Operators

Name Description

Public function

bool

 

operator!=

(
    const FName & Other
)

Public function

bool

 

operator!=

(
    const CharType* Other
)

Inequality operator.

true if name does not match the string, false otherwise

Public function

bool

 

operator<

(
    const FName & Other
)

Comparison operator used for sorting alphabetically.

Public function

bool

 

operator==

(
    const FName & Other
)

Public function

bool

 

operator==

(
    const CharType* Other
)

Equality operator.

true if name matches the string, false otherwise

Public function

bool

 

operator>

(
    const FName & Other
)

Comparison operator used for sorting alphabetically.

Constants

Name

Description

NameEntryMemorySize

Size of all name entries.

NameHashHead

Static variables.

NameHashTail

Name hash tail - insert new entries after this - NON ATOMIC!

NumAnsiNames

Number of ANSI names in name table.

NumWideNames

Number of wide names in name table.

References

Module

Core

Header

Runtime/Core/Public/UObject/NameTypes.h