UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UnrealString.h.inl File Reference

Go to the source code of this file.

Classes

class  UE_STRING_CLASS
 
struct  TIsZeroConstructType< UE_STRING_CLASS >
 
struct  TNameOf< UE_STRING_CLASS >
 

Macros

#define UE_INCLUDETOOL_IGNORE_INCONSISTENT_STATE
 

Typedefs

using FormatNamedArguments = TMap< UE_STRING_CLASS, FStringFormatArg >
 
using FStringFormatOrderedArguments = TArray< FStringFormatArg >
 

Functions

UE_STRING_CHARTYPEGetData (UE_STRING_CLASS &)
 
const UE_STRING_CHARTYPEGetData (const UE_STRING_CLASS &)
 
int32 GetNum (const UE_STRING_CLASS &String)
 
CORE_API void BytesToHex (const uint8 *Bytes, int32 NumBytes, UE_STRING_CLASS &Out)
 
CORE_API void BytesToHexLower (const uint8 *Bytes, int32 NumBytes, UE_STRING_CLASS &Out)
 
CORE_API int32 HexToBytes (const UE_STRING_CLASS &HexString, uint8 *OutBytes)
 
void LexFromString (int8 &OutValue, const UE_STRING_CHARTYPE *Buffer)
 
void LexFromString (int16 &OutValue, const UE_STRING_CHARTYPE *Buffer)
 
void LexFromString (int32 &OutValue, const UE_STRING_CHARTYPE *Buffer)
 
void LexFromString (int64 &OutValue, const UE_STRING_CHARTYPE *Buffer)
 
void LexFromString (uint8 &OutValue, const UE_STRING_CHARTYPE *Buffer)
 
void LexFromString (uint16 &OutValue, const UE_STRING_CHARTYPE *Buffer)
 
void LexFromString (uint32 &OutValue, const UE_STRING_CHARTYPE *Buffer)
 
void LexFromString (uint64 &OutValue, const UE_STRING_CHARTYPE *Buffer)
 
void LexFromString (float &OutValue, const UE_STRING_CHARTYPE *Buffer)
 
void LexFromString (double &OutValue, const UE_STRING_CHARTYPE *Buffer)
 
void LexFromString (bool &OutValue, const UE_STRING_CHARTYPE *Buffer)
 
void LexFromString (UE_STRING_CLASS &OutValue, const UE_STRING_CHARTYPE *Buffer)
 
template<UE::CArithmetic T>
bool LexTryParseString (T &OutValue, const UE_STRING_CHARTYPE *Buffer)
 
bool LexTryParseString (bool &OutValue, const UE_STRING_CHARTYPE *Buffer)
 
template<typename StringType = FString>
UE_FORCEINLINE_HINT StringType LexToString (UE_STRING_CLASS &&Str)
 
template<typename StringType = FString>
UE_FORCEINLINE_HINT StringType LexToString (const UE_STRING_CLASS &Str)
 
UE_FORCEINLINE_HINT const UE_STRING_CLASS::ElementType * ToCStr (const UE_STRING_CLASS &Str)
 
CORE_API int32 FindMatchingClosingParenthesis (const UE_STRING_CLASS &TargetString, const int32 StartSearch=0)
 
CORE_API UE_STRING_CLASS SlugStringForValidName (const UE_STRING_CLASS &DisplayString, const TCHAR *ReplaceWith=TEXT(""))
 

Macro Definition Documentation

◆ UE_INCLUDETOOL_IGNORE_INCONSISTENT_STATE

#define UE_INCLUDETOOL_IGNORE_INCONSISTENT_STATE

Typedef Documentation

◆ FormatNamedArguments

◆ FStringFormatOrderedArguments

Function Documentation

◆ BytesToHex()

CORE_API void BytesToHex ( const uint8 Bytes,
int32  NumBytes,
UE_STRING_CLASS Out 
)

Append bytes as uppercase hex string

◆ BytesToHexLower()

CORE_API void BytesToHexLower ( const uint8 Bytes,
int32  NumBytes,
UE_STRING_CLASS Out 
)

Append bytes as lowercase hex string

◆ FindMatchingClosingParenthesis()

CORE_API int32 FindMatchingClosingParenthesis ( const UE_STRING_CLASS TargetString,
const int32  StartSearch = 0 
)

A helper function to find closing parenthesis that matches the first open parenthesis found. The open parenthesis referred to must be at or further up from the start index.

Parameters
TargetStringThe string to search in
StartSearchThe index to start searching at
Returns
the index in the given string of the closing parenthesis

◆ GetData() [1/2]

const UE_STRING_CLASS::ElementType * GetData ( const UE_STRING_CLASS String)
inline

◆ GetData() [2/2]

UE_STRING_CLASS::ElementType * GetData ( UE_STRING_CLASS String)
inline

◆ GetNum()

int32 GetNum ( const UE_STRING_CLASS String)
inline

◆ HexToBytes()

CORE_API int32 HexToBytes ( const UE_STRING_CLASS HexString,
uint8 OutBytes 
)

Convert a string of Hex digits into the byte array.

Parameters
HexStringThe string of Hex values
OutBytesPtr to memory must be preallocated large enough
Returns
The number of bytes copied

◆ LexFromString() [1/12]

void LexFromString ( bool OutValue,
const UE_STRING_CHARTYPE Buffer 
)
inline

◆ LexFromString() [2/12]

void LexFromString ( double OutValue,
const UE_STRING_CHARTYPE Buffer 
)
inline

◆ LexFromString() [3/12]

void LexFromString ( float OutValue,
const UE_STRING_CHARTYPE Buffer 
)
inline

◆ LexFromString() [4/12]

void LexFromString ( int16 OutValue,
const UE_STRING_CHARTYPE Buffer 
)
inline

◆ LexFromString() [5/12]

void LexFromString ( int32 OutValue,
const UE_STRING_CHARTYPE Buffer 
)
inline

◆ LexFromString() [6/12]

void LexFromString ( int64 OutValue,
const UE_STRING_CHARTYPE Buffer 
)
inline

◆ LexFromString() [7/12]

void LexFromString ( int8 OutValue,
const UE_STRING_CHARTYPE Buffer 
)
inline

Generalized API to convert something to a string. Function named after the (deprecated) Lex namespace, which was deprecated because introducing customization points in a nested namespace didn't work in generic code because it foiled 2-phase template instantiating compilers, which would bind to the qualified name (LexToString) in the first phase, preventing future overloads defined in later headers to be considered for binding. Expected functions in this namespace are as follows: bool LexTryParseString(T& OutValue, const TCHAR* Buffer); void LexFromString(T& OutValue, const TCHAR* Buffer); <implicitly convertible to string> LexToString(T); ^– Generally this means it can return either a string or const TCHAR* Generic code that uses ToString should assign to a string or forward along to other functions that accept types that are also implicitly convertible to a string

Implement custom functionality externally. Convert a string buffer to intrinsic types

◆ LexFromString() [8/12]

void LexFromString ( UE_STRING_CLASS OutValue,
const UE_STRING_CHARTYPE Buffer 
)
inline

◆ LexFromString() [9/12]

void LexFromString ( uint16 OutValue,
const UE_STRING_CHARTYPE Buffer 
)
inline

◆ LexFromString() [10/12]

void LexFromString ( uint32 OutValue,
const UE_STRING_CHARTYPE Buffer 
)
inline

◆ LexFromString() [11/12]

void LexFromString ( uint64 OutValue,
const UE_STRING_CHARTYPE Buffer 
)
inline

◆ LexFromString() [12/12]

void LexFromString ( uint8 OutValue,
const UE_STRING_CHARTYPE Buffer 
)
inline

◆ LexToString() [1/2]

template<typename StringType = FString>
UE_FORCEINLINE_HINT StringType LexToString ( const UE_STRING_CLASS Str)

◆ LexToString() [2/2]

template<typename StringType = FString>
UE_FORCEINLINE_HINT StringType LexToString ( UE_STRING_CLASS &&  Str)

◆ LexTryParseString() [1/2]

bool LexTryParseString ( bool OutValue,
const UE_STRING_CHARTYPE Buffer 
)
inline

Try and parse a bool - always returns true

◆ LexTryParseString() [2/2]

template<UE::CArithmetic T>
bool LexTryParseString ( T &  OutValue,
const UE_STRING_CHARTYPE Buffer 
)

Parse a string into this type, returning whether it was successful Specialization for arithmetic types

◆ SlugStringForValidName()

CORE_API UE_STRING_CLASS SlugStringForValidName ( const UE_STRING_CLASS DisplayString,
const TCHAR ReplaceWith = TEXT("") 
)

Given a display label string, generates a slug string that only contains valid characters for an FName. For example, "[MyObject]: Object Label" becomes "MyObjectObjectLabel" FName slug.

Parameters
DisplayLabelThe label string to convert to an FName
Returns
The slugged string

◆ ToCStr()

UE_FORCEINLINE_HINT const UE_STRING_CLASS::ElementType * ToCStr ( const UE_STRING_CLASS Str)

Gets a non-owning character pointer from a string type.

Can be used generically to get a const char pointer, when it is not known if the argument is a char pointer or a string:

template <typename T> void LogValue(const T& Val) { Logf(TEXT("Value: %s"), ToCStr(LexToString(Val))); }