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

#include <RHIDefinitions.h>

Public Member Functions

RHI_API FDebugName ()
 
RHI_API FDebugName (FName InName)
 
RHI_API FDebugName (FName InName, int32 InNumber)
 
RHI_API FDebugNameoperator= (FName Other)
 
RHI_API FString ToString () const
 
 UE_DEPRECATED (5.6, "FDebugName::ToString(TCHAR* Out, uint32 OutSize) is dangerous and can lead to buffer overflow if the provided " "buffer is smaller than FDebugName::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() function that returns an FString.") uint32 ToString(TCHAR *Out
 
return ToStringInternal (Out, OutSize)
 
template<uint32 N>
uint32 ToString (TCHAR(&Out)[N]) const
 
template<uint32 N>
uint32 ToStringTruncate (TCHAR(&Out)[N]) const
 
bool IsNone () const
 
RHI_API void AppendString (FStringBuilderBase &Builder) const
 

Public Attributes

uint32 OutSize const
 

Static Public Attributes

static constexpr uint32 StringBufferSize = FName::StringBufferSize + 1 + 10
 

Detailed Description

A type used only for printing a string for debugging/profiling. Adds Number as a suffix to the printed string even if the base name includes a number, so may prints a string like: Base_1_1 This type will always store a numeric suffix explicitly inside itself and never in the name table so it will always be at least 12 bytes regardless of the value of UE_FNAME_OUTLINE_NUMBER. It is not comparable or convertible to other name types to encourage its use only for debugging and avoid using more storage than necessary for the primary use cases of FName (names of objects, assets etc which are widely used and therefor deduped in the name table).

Constructor & Destructor Documentation

◆ FDebugName() [1/3]

FDebugName::FDebugName ( )

◆ FDebugName() [2/3]

FDebugName::FDebugName ( FName  InName)

◆ FDebugName() [3/3]

FDebugName::FDebugName ( FName  InName,
int32  InNumber 
)

Member Function Documentation

◆ AppendString()

void FDebugName::AppendString ( FStringBuilderBase Builder) const

◆ IsNone()

bool FDebugName::IsNone ( ) const
inline

◆ operator=()

FDebugName & FDebugName::operator= ( FName  Other)

◆ ToString() [1/2]

FString FDebugName::ToString ( ) const

◆ ToString() [2/2]

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

Converts the FDebugName to a string buffer, avoiding dynamic allocations. Returns the length of the string, excluding the null terminator.

◆ ToStringInternal()

return FDebugName::ToStringInternal ( Out  ,
OutSize   
)

◆ ToStringTruncate()

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

Converts the FDebugName 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 FDebugName::StringBufferSize to avoid truncation.

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

◆ UE_DEPRECATED()

FDebugName::UE_DEPRECATED ( 5.  6,
"FDebugName::ToString(TCHAR* Out, uint32 OutSize) is dangerous and can lead to buffer overflow if the provided " "buffer is smaller than FDebugName::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() function that returns an FString."   
)

Member Data Documentation

◆ const

uint32 OutSize FDebugName::const
Initial value:
{
#define check(expr)
Definition AssertionMacros.h:314
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
static constexpr uint32 StringBufferSize
Definition RHIDefinitions.h:98

◆ StringBufferSize

constexpr uint32 FDebugName::StringBufferSize = FName::StringBufferSize + 1 + 10
staticconstexpr

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