Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
UnrealString.h File Reference
+ Include dependency graph for UnrealString.h:

Go to the source code of this file.

Classes

class  FString
 
struct  FString::TIsRangeOfCharType< CharRangeType >
 
struct  FString::TIsRangeOfTCHAR< CharRangeType >
 
struct  TIsZeroConstructType< FString >
 
struct  TTypeToString< T >
 
struct  TTypeFromString< T >
 
class  FStringOutputDevice
 
struct  TIsContiguousContainer< FStringOutputDevice >
 
class  FStringOutputDeviceCountLines
 
struct  TIsContiguousContainer< FStringOutputDeviceCountLines >
 
struct  FTextRange
 

Namespaces

namespace  StringConv
 

Typedefs

typedef TMap< FString, FStringFormatArgFStringFormatNamedArguments
 
typedef TArray< FStringFormatArgFStringFormatOrderedArguments
 

Functions

TCHARGetData (FString &)
 
const TCHARGetData (const FString &)
 
int32 GetNum (const FString &String)
 
 Expose_TNameOf (FString) inline TCHAR *GetData(FString &String)
 
UE_NODISCARD FString BytesToString (const uint8 *In, int32 Count)
 
int32 StringToBytes (const FString &String, uint8 *OutBytes, int32 MaxBufferSize)
 
UE_NODISCARD TCHAR NibbleToTChar (uint8 Num)
 
void ByteToHex (uint8 In, FString &Result)
 
void BytesToHex (const uint8 *Bytes, int32 NumBytes, FString &Out)
 
void BytesToHexLower (const uint8 *Bytes, int32 NumBytes, FString &Out)
 
UE_NODISCARD FString BytesToHex (const uint8 *Bytes, int32 NumBytes)
 
UE_NODISCARD FString BytesToHexLower (const uint8 *Bytes, int32 NumBytes)
 
UE_NODISCARD const bool CheckTCharIsHex (const TCHAR Char)
 
UE_NODISCARD const uint8 TCharToNibble (const TCHAR Hex)
 
int32 HexToBytes (const FString &HexString, uint8 *OutBytes)
 
void LexFromString (int8 &OutValue, const TCHAR *Buffer)
 
void LexFromString (int16 &OutValue, const TCHAR *Buffer)
 
void LexFromString (int32 &OutValue, const TCHAR *Buffer)
 
void LexFromString (int64 &OutValue, const TCHAR *Buffer)
 
void LexFromString (uint8 &OutValue, const TCHAR *Buffer)
 
void LexFromString (uint16 &OutValue, const TCHAR *Buffer)
 
void LexFromString (uint32 &OutValue, const TCHAR *Buffer)
 
void LexFromString (uint64 &OutValue, const TCHAR *Buffer)
 
void LexFromString (float &OutValue, const TCHAR *Buffer)
 
void LexFromString (double &OutValue, const TCHAR *Buffer)
 
void LexFromString (bool &OutValue, const TCHAR *Buffer)
 
void LexFromString (FString &OutValue, const TCHAR *Buffer)
 
template<typename T >
UE_NODISCARD TEnableIf< TIsArithmetic< T >::Value, FString >::Type LexToString (const T &Value)
 
template<typename CharType >
UE_NODISCARD TEnableIf< TIsCharType< CharType >::Value, FString >::Type LexToString (const CharType *Ptr)
 
UE_NODISCARD FString LexToString (bool Value)
 
UE_NODISCARD FORCEINLINE FString LexToString (FString &&Str)
 
UE_NODISCARD FORCEINLINE FString LexToString (const FString &Str)
 
template<typename T >
UE_NODISCARD FString LexToSanitizedString (const T &Value)
 
UE_NODISCARD FString LexToSanitizedString (float Value)
 
UE_NODISCARD FString LexToSanitizedString (double Value)
 
template<typename T >
static TEnableIf< TIsArithmetic< T >::Value, bool >::Type LexTryParseString (T &OutValue, const TCHAR *Buffer)
 
static bool LexTryParseString (bool &OutValue, const TCHAR *Buffer)
 
FORCEINLINE const TCHARToCStr (const TCHAR *Ptr)
 
FORCEINLINE const TCHARToCStr (const FString &Str)
 
void StringConv::InlineCombineSurrogates (FString &Str)
 
int32 FindMatchingClosingParenthesis (const FString &TargetString, const int32 StartSearch=0)
 
ARK_API FString SlugStringForValidName (const FString &DisplayString, const TCHAR *ReplaceWith=TEXT(""))
 

Typedef Documentation

◆ FStringFormatNamedArguments

◆ FStringFormatOrderedArguments

Function Documentation

◆ BytesToHex() [1/2]

UE_NODISCARD FString BytesToHex ( const uint8 * Bytes,
int32 NumBytes )
inline

Convert bytes to uppercase hex string

Definition at line 2551 of file UnrealString.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ BytesToHex() [2/2]

void BytesToHex ( const uint8 * Bytes,
int32 NumBytes,
FString & Out )

Append bytes as uppercase hex string

+ Here is the caller graph for this function:

◆ BytesToHexLower() [1/2]

UE_NODISCARD FString BytesToHexLower ( const uint8 * Bytes,
int32 NumBytes )
inline

Convert bytes to lowercase hex string

Definition at line 2559 of file UnrealString.h.

+ Here is the call graph for this function:

◆ BytesToHexLower() [2/2]

void BytesToHexLower ( const uint8 * Bytes,
int32 NumBytes,
FString & Out )

Append bytes as lowercase hex string

+ Here is the caller graph for this function:

◆ BytesToString()

UE_NODISCARD FString BytesToString ( const uint8 * In,
int32 Count )
inline

Convert an array of bytes to a TCHAR

Parameters
Inbyte array values to convert
Countnumber of bytes to convert
Returns
Valid string representing bytes.

Definition at line 2484 of file UnrealString.h.

+ Here is the call graph for this function:

◆ ByteToHex()

void ByteToHex ( uint8 In,
FString & Result )
inline

Convert a byte to hex

Parameters
Inbyte value to convert
Resultout hex value output

Definition at line 2539 of file UnrealString.h.

+ Here is the call graph for this function:

◆ CheckTCharIsHex()

UE_NODISCARD const bool CheckTCharIsHex ( const TCHAR Char)
inline

Checks if the TChar is a valid hex character

Parameters
CharThe character
Returns
True if in 0-9 and A-F ranges

Definition at line 2571 of file UnrealString.h.

◆ Expose_TNameOf()

Expose_TNameOf ( FString ) &

Definition at line 2461 of file UnrealString.h.

◆ FindMatchingClosingParenthesis()

int32 FindMatchingClosingParenthesis ( const FString & 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

Definition at line 1512 of file String.cpp.

+ Here is the call graph for this function:

◆ GetData() [1/2]

const TCHAR * GetData ( const FString & String)
inline

Definition at line 2468 of file UnrealString.h.

◆ GetData() [2/2]

TCHAR * GetData ( FString & )

◆ GetNum()

int32 GetNum ( const FString & String)
inline

Definition at line 2473 of file UnrealString.h.

+ Here is the call graph for this function:

◆ HexToBytes()

int32 HexToBytes ( const FString & HexString,
uint8 * OutBytes )

Convert FString of Hex digits into the byte array.

Parameters
HexStringThe FString 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 TCHAR * Buffer )
inline

Definition at line 2636 of file UnrealString.h.

+ Here is the caller graph for this function:

◆ LexFromString() [2/12]

void LexFromString ( double & OutValue,
const TCHAR * Buffer )
inline

Definition at line 2635 of file UnrealString.h.

◆ LexFromString() [3/12]

void LexFromString ( float & OutValue,
const TCHAR * Buffer )
inline

Definition at line 2634 of file UnrealString.h.

◆ LexFromString() [4/12]

void LexFromString ( FString & OutValue,
const TCHAR * Buffer )
inline

Definition at line 2637 of file UnrealString.h.

+ Here is the call graph for this function:

◆ LexFromString() [5/12]

void LexFromString ( int16 & OutValue,
const TCHAR * Buffer )
inline

Definition at line 2627 of file UnrealString.h.

◆ LexFromString() [6/12]

void LexFromString ( int32 & OutValue,
const TCHAR * Buffer )
inline

Definition at line 2628 of file UnrealString.h.

◆ LexFromString() [7/12]

void LexFromString ( int64 & OutValue,
const TCHAR * Buffer )
inline

Definition at line 2629 of file UnrealString.h.

◆ LexFromString() [8/12]

void LexFromString ( int8 & OutValue,
const TCHAR * 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 FString or const TCHAR* Generic code that uses ToString should assign to an FString or forward along to other functions that accept types that are also implicitly convertible to FString

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

Definition at line 2626 of file UnrealString.h.

◆ LexFromString() [9/12]

void LexFromString ( uint16 & OutValue,
const TCHAR * Buffer )
inline

Definition at line 2631 of file UnrealString.h.

◆ LexFromString() [10/12]

void LexFromString ( uint32 & OutValue,
const TCHAR * Buffer )
inline

Definition at line 2632 of file UnrealString.h.

◆ LexFromString() [11/12]

void LexFromString ( uint64 & OutValue,
const TCHAR * Buffer )
inline

Definition at line 2633 of file UnrealString.h.

◆ LexFromString() [12/12]

void LexFromString ( uint8 & OutValue,
const TCHAR * Buffer )
inline

Definition at line 2630 of file UnrealString.h.

◆ LexToSanitizedString() [1/3]

template<typename T >
UE_NODISCARD FString LexToSanitizedString ( const T & Value)

Helper template to convert to sanitized strings

Definition at line 2672 of file UnrealString.h.

◆ LexToSanitizedString() [2/3]

UE_NODISCARD FString LexToSanitizedString ( double Value)
inline

Overloaded for doubles

Definition at line 2684 of file UnrealString.h.

+ Here is the call graph for this function:

◆ LexToSanitizedString() [3/3]

UE_NODISCARD FString LexToSanitizedString ( float Value)
inline

Overloaded for floats

Definition at line 2678 of file UnrealString.h.

+ Here is the call graph for this function:

◆ LexToString() [1/5]

UE_NODISCARD FString LexToString ( bool Value)
inline

Definition at line 2655 of file UnrealString.h.

◆ LexToString() [2/5]

template<typename CharType >
UE_NODISCARD TEnableIf< TIsCharType< CharType >::Value, FString >::Type LexToString ( const CharType * Ptr)

Definition at line 2650 of file UnrealString.h.

◆ LexToString() [3/5]

UE_NODISCARD FORCEINLINE FString LexToString ( const FString & Str)

Definition at line 2665 of file UnrealString.h.

◆ LexToString() [4/5]

template<typename T >
UE_NODISCARD TEnableIf< TIsArithmetic< T >::Value, FString >::Type LexToString ( const T & Value)

Convert numeric types to a string

Definition at line 2642 of file UnrealString.h.

◆ LexToString() [5/5]

UE_NODISCARD FORCEINLINE FString LexToString ( FString && Str)

Definition at line 2660 of file UnrealString.h.

◆ LexTryParseString() [1/2]

static bool LexTryParseString ( bool & OutValue,
const TCHAR * Buffer )
static

Try and parse a bool - always returns true

Definition at line 2728 of file UnrealString.h.

+ Here is the call graph for this function:

◆ LexTryParseString() [2/2]

template<typename T >
static TEnableIf< TIsArithmetic< T >::Value, bool >::Type LexTryParseString ( T & OutValue,
const TCHAR * Buffer )
static

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

Definition at line 2693 of file UnrealString.h.

◆ NibbleToTChar()

UE_NODISCARD TCHAR NibbleToTChar ( uint8 Num)
inline

Returns Char value of Nibble

Definition at line 2525 of file UnrealString.h.

+ Here is the caller graph for this function:

◆ SlugStringForValidName()

ARK_API FString SlugStringForValidName ( const FString & DisplayString,
const TCHAR * ReplaceWith = TEXT("") )

Given a display label string, generates an FString slug 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

Definition at line 1555 of file String.cpp.

◆ StringToBytes()

int32 StringToBytes ( const FString & String,
uint8 * OutBytes,
int32 MaxBufferSize )
inline

Convert FString of bytes into the byte array.

Parameters
StringThe FString of byte values
OutBytesPtr to memory must be preallocated large enough
MaxBufferSizeMax buffer size of the OutBytes array, to prevent overflow
Returns
The number of bytes copied

Definition at line 2510 of file UnrealString.h.

+ Here is the call graph for this function:

◆ TCharToNibble()

UE_NODISCARD const uint8 TCharToNibble ( const TCHAR Hex)
inline

Convert a TChar to equivalent hex value as a uint8

Parameters
HexThe character
Returns
The uint8 value of a hex character

Definition at line 2581 of file UnrealString.h.

◆ ToCStr() [1/2]

FORCEINLINE const TCHAR * ToCStr ( const FString & Str)

Definition at line 2763 of file UnrealString.h.

+ Here is the call graph for this function:

◆ ToCStr() [2/2]

FORCEINLINE const TCHAR * ToCStr ( const TCHAR * Ptr)

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

Can be used generically to get a const TCHAR*, when it is not known if the argument is a TCHAR* or an FString:

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

Definition at line 2759 of file UnrealString.h.