Public name, available to the world. 更多...
#include <NameTypes.h>
Public 成员函数 | |
| void | AppendString (FString &Out) const |
| Converts an FName to a readable format, in place, appending to an existing string (ala GetFullName) 更多... | |
| void | AppendString (FStringBuilderBase &Out) const |
| Converts an FName to a readable format, in place, appending to an existing string (ala GetFullName) 更多... | |
| int32 | Compare (const FName &Other) const |
| Compares name to passed in one. 更多... | |
| FORCEINLINE int32 | CompareIndexes (const FName &Other) const |
| Fast compares name to passed in one using indexes. 更多... | |
| FORCEINLINE bool | FastLess (const FName &Other) const |
| Fast non-alphabetical order that is only stable during this process' lifetime. | |
| FORCEINLINE | FName () |
| Default constructor, initialized to None | |
| FORCEINLINE | FName (const FName &Other, int32 InNumber) |
| Create an FName from an existing string, but with a different instance. 更多... | |
| FORCEINLINE | FName (const FNameEntryId InComparisonIndex, const FNameEntryId InDisplayIndex, const int32 InNumber) |
| Create an FName from its component parts Only call this if you really know what you're doing | |
| 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. 更多... | |
| FName (const TCHAR *Name, int32 InNumber, EFindName FindType, bool bSplitName) | |
| Create an FName. 更多... | |
| FName (const WIDECHAR *Name, EFindName FindType=FNAME_Add) | |
| Create an FName. 更多... | |
| FName (const WIDECHAR *Name, int32 InNumber, EFindName FindType=FNAME_Add) | |
| Create an FName. 更多... | |
| FORCEINLINE | FName (EName Ename) |
| Create an FName with a hardcoded string index. 更多... | |
| FORCEINLINE | FName (EName Ename, int32 InNumber) |
| Create an FName with a hardcoded string index and (instance). 更多... | |
| FName (ENoInit) | |
| Scary no init constructor, used for something obscure in UObjectBase | |
| FName (int32 Len, const WIDECHAR *Name, EFindName FindType=FNAME_Add) | |
| Create FName from non-null string with known length | |
| void | GetPlainANSIString (ANSICHAR(&AnsiName)[NAME_SIZE]) const |
| Copy ANSI name without number part. 更多... | |
| FString | GetPlainNameString () const |
| Get name without number part as a dynamically allocated string | |
| uint32 | GetPlainNameString (TCHAR(&OutName)[NAME_SIZE]) const |
| Convert name without number part into TCHAR buffer and returns string length. 更多... | |
| void | GetPlainWIDEString (WIDECHAR(&WideName)[NAME_SIZE]) const |
| Copy wide name without number part. 更多... | |
| uint32 | GetStringLength () const |
| Get the number of characters, excluding null-terminator, that ToString() would yield | |
| FORCEINLINE bool | 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 | |
| FORCEINLINE bool | IsNone () const |
| True for FName(), FName(NAME_None) and FName("None") | |
| bool | IsValid () const |
| Paranoid sanity check 更多... | |
| bool | 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. 更多... | |
| bool | IsValidIndexFast () const |
| Paranoid sanity check, same as IsValid() | |
| bool | IsValidObjectName (FText &OutReason) const |
| Takes an FName and checks to see that it follows the rules that Unreal requires for object names. 更多... | |
| bool | IsValidXName (const FString &InInvalidChars=INVALID_NAME_CHARACTERS, FText *OutReason=nullptr, const FText *InErrorCtx=nullptr) const |
| Checks to see that a FName follows the rules that Unreal requires. 更多... | |
| bool | IsValidXName (FText &OutReason, const FString &InInvalidChars=INVALID_NAME_CHARACTERS) const |
| Takes an FName and checks to see that it follows the rules that Unreal requires. 更多... | |
| FORCEINLINE bool | LexicalLess (const FName &Other) const |
| Slow alphabetical order that is stable / deterministic over process runs. | |
| template<typename CharType > | |
| bool | operator!= (const CharType *Other) const |
| Inequality operator. 更多... | |
| bool | operator== (const ANSICHAR *Other) const |
| Equality operator. 更多... | |
| const EName * | ToEName () const |
| Get the EName that this FName represents or nullptr | |
| FString | ToString () const |
| Converts an FName to a readable format 更多... | |
| void | ToString (FString &Out) const |
| Converts an FName to a readable format, in place 更多... | |
| void | ToString (FStringBuilderBase &Out) const |
| Converts an FName to a readable format, in place 更多... | |
| uint32 | ToString (TCHAR *Out, uint32 OutSize) const |
| Convert to string buffer to avoid dynamic allocations and returns string length 更多... | |
| bool | TryAppendAnsiString (FAnsiStringBuilderBase &Out) const |
| Converts an ANSI FName to a readable format appended to the string builder. 更多... | |
静态 Public 成员函数 | |
| static void | AutoTest () |
| Run autotest on FNames. | |
| static FName | CreateFromDisplayId (FNameEntryId DisplayId, int32 Number) |
| Only call this if you really know what you're doing | |
| static int32 | GetNameEntryMemorySize () |
| static int32 | GetNameTableMemorySize () |
| static int32 | GetNumAnsiNames () |
| static int32 | GetNumWideNames () |
| static bool | IsValidXName (const FName InName, const FString &InInvalidChars, FText *OutReason=nullptr, const FText *InErrorCtx=nullptr) |
| Checks to see that a given name-like string follows the rules that Unreal requires. 更多... | |
| static FString | NameToDisplayString (const FString &InDisplayName, const bool bIsBool) |
| Takes a string and breaks it down into a human readable string. 更多... | |
| static void | TearDown () |
| Tear down system and free all allocated memory 更多... | |
静态 Public 属性 | |
| static constexpr uint32 | StringBufferSize = NAME_SIZE + 1 + 10 |
| Buffer size required for any null-terminated FName string, i.e. 更多... | |
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)
|
inline |
Create an FName with a hardcoded string index.
| N | The hardcoded value the string portion of the name will have. The number portion will be NAME_NO_NUMBER |
|
inline |
Create an FName with a hardcoded string index and (instance).
| N | The hardcoded value the string portion of the name will have |
| InNumber | The hardcoded value for the number portion of the name |
|
inline |
| FName::FName | ( | const WIDECHAR * | Name, |
| EFindName | FindType = FNAME_Add |
||
| ) |
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
| Name | Value for the string portion of the name |
| FindType | Action to take (see EFindName) |
| FName::FName | ( | const WIDECHAR * | Name, |
| int32 | InNumber, | ||
| EFindName | FindType = FNAME_Add |
||
| ) |
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
| Name | Value for the string portion of the name |
| Number | Value for the number portion of the name |
| FindType | Action to take (see EFindName) |
| bSplitName | true 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::FName | ( | const TCHAR * | Name, |
| int32 | InNumber, | ||
| EFindName | FindType, | ||
| 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
| Name | Value for the string portion of the name |
| Number | Value for the number portion of the name |
| FindType | Action to take (see EFindName) |
| bSplitName | true 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::FName | ( | const FNameEntrySerialized & | LoadedEntry | ) |
| void FName::AppendString | ( | FString & | Out | ) | const |
Converts an FName to a readable format, in place, appending to an existing string (ala GetFullName)
| Out | String to append with the string representation of the name |
| void FName::AppendString | ( | FStringBuilderBase & | Out | ) | const |
Converts an FName to a readable format, in place, appending to an existing string (ala GetFullName)
| Out | StringBuilder to append with the string representation of the name |
| int32 FName::Compare | ( | const FName & | Other | ) | const |
Compares name to passed in one.
Sort is alphabetical ascending.
| Other | Name to compare this against |
|
inline |
Fast compares name to passed in one using indexes.
Sort is allocation order ascending.
| Other | Name to compare this against |
|
static |
|
static |
|
static |
|
static |
| void FName::GetPlainANSIString | ( | ANSICHAR(&) | AnsiName[NAME_SIZE] | ) | const |
Copy ANSI name without number part.
Must only be used for ANSI FNames. Doesn't allocate.
| uint32 FName::GetPlainNameString | ( | TCHAR(&) | OutName[NAME_SIZE] | ) | const |
Convert name without number part into TCHAR buffer and returns string length.
Doesn't allocate.
| void FName::GetPlainWIDEString | ( | WIDECHAR(&) | WideName[NAME_SIZE] | ) | const |
Copy wide name without number part.
Must only be used for wide FNames. Doesn't allocate.
|
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.
|
inline |
Takes an FName and checks to see that it follows the rules that Unreal requires for package or group names.
| OutReason | If the check fails, this string is filled in with the reason why. |
| bIsGroupName | if true, check legality for a group name, else check legality for a package name |
|
inline |
Takes an FName and checks to see that it follows the rules that Unreal requires for object names.
| OutReason | If the check fails, this string is filled in with the reason why. |
|
static |
Checks to see that a given name-like string follows the rules that Unreal requires.
| InName | String containing the name to test. |
| InInvalidChars | The set of invalid characters that the name cannot contain. |
| OutReason | If the check fails, this string is filled in with the reason why. |
| InErrorCtx | Error context information to show in the error message (default is "Name"). |
|
inline |
Checks to see that a FName follows the rules that Unreal requires.
| InInvalidChars | The set of invalid characters that the name cannot contain |
| OutReason | If the check fails, this string is filled in with the reason why. |
| InErrorCtx | Error context information to show in the error message (default is "Name"). |
|
inline |
Takes an FName and checks to see that it follows the rules that Unreal requires.
| OutReason | If the check fails, this string is filled in with the reason why. |
| InInvalidChars | The set of invalid characters that the name cannot contain |
|
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".
| InDisplayName | [In, Out] The name to sanitize |
| bIsBool | True if the name is a bool |
|
inline |
Inequality operator.
| Other | String to compare this name to |
| bool FName::operator== | ( | const ANSICHAR * | Other | ) | const |
Equality operator.
| Other | String to compare this name to |
|
static |
Tear down system and free all allocated memory
FName must not be used after teardown
| FString FName::ToString | ( | ) | const |
Converts an FName to a readable format
| void FName::ToString | ( | FString & | Out | ) | const |
Converts an FName to a readable format, in place
| Out | String to fill with the string representation of the name |
| void FName::ToString | ( | FStringBuilderBase & | Out | ) | const |
Converts an FName to a readable format, in place
| Out | StringBuilder to fill with the string representation of the name |
| uint32 FName::ToString | ( | TCHAR * | Out, |
| uint32 | OutSize | ||
| ) | const |
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 ""
| bool FName::TryAppendAnsiString | ( | FAnsiStringBuilderBase & | Out | ) | const |
Converts an ANSI FName to a readable format appended to the string builder.
| Out | A string builder to write the readable representation of the name into. |
|
staticconstexpr |
Buffer size required for any null-terminated FName string, i.e.
[name] '_' [digits] '\0'