Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FGenericPlatformString Struct Reference

#include <GenericPlatformString.h>

+ Inheritance diagram for FGenericPlatformString:
+ Collaboration diagram for FGenericPlatformString:

Public Member Functions

template<typename T >
struct UE_DEPRECATED (5.0, "TIsFixedWidthEncoding is deprecated, use TIsFixedWidthCharEncoding_V<T> instead.") TIsFixedWidthEncoding
 
template<typename EncodingA , typename EncodingB >
struct UE_DEPRECATED (5.0, "TAreEncodingsCompatible is deprecated, use TIsCharEncodingCompatibleWith_V<SrcEncoding, DestEncoding> instead.") TAreEncodingsCompatible
 

Static Public Member Functions

template<typename Encoding >
static constexpr bool IsFixedWidthEncoding ()
 
template<typename SrcEncoding , typename DestEncoding >
static constexpr bool IsCharEncodingCompatibleWith ()
 
template<typename SourceEncoding , typename DestEncoding >
static constexpr bool IsCharEncodingSimplyConvertibleTo ()
 
template<typename DestEncoding , typename SourceEncoding >
static constexpr bool CanConvertCodepoint (SourceEncoding Codepoint)
 
template<typename Encoding >
static const TCHARGetEncodingTypeName ()
 
static const ANSICHARGetEncodingName ()
 
template<typename SourceEncoding , typename DestEncoding >
static FORCEINLINE DestEncodingConvert (DestEncoding *Dest, int32 DestSize, const SourceEncoding *Src)
 
template<typename SourceEncoding , typename DestEncoding >
static FORCEINLINE DestEncodingConvert (DestEncoding *Dest, int32 DestSize, const SourceEncoding *Src, int32 SrcSize)
 
template<typename DestEncoding , typename SourceEncoding >
static int32 ConvertedLength (const SourceEncoding *Src)
 
template<typename DestEncoding , typename SourceEncoding >
static int32 ConvertedLength (const SourceEncoding *Src, int32 SrcSize)
 
static int32 Strncmp (const ANSICHAR *String1, const ANSICHAR *String2, SIZE_T Count)
 
static int32 Strncmp (const WIDECHAR *String1, const ANSICHAR *String2, SIZE_T Count)
 
static int32 Strncmp (const UTF8CHAR *String1, const ANSICHAR *String2, SIZE_T Count)
 
static int32 Strncmp (const ANSICHAR *String1, const WIDECHAR *String2, SIZE_T Count)
 
static int32 Strncmp (const WIDECHAR *String1, const WIDECHAR *String2, SIZE_T Count)
 
static int32 Strncmp (const UTF8CHAR *String1, const WIDECHAR *String2, SIZE_T Count)
 
static int32 Strncmp (const ANSICHAR *String1, const UTF8CHAR *String2, SIZE_T Count)
 
static int32 Strncmp (const WIDECHAR *String1, const UTF8CHAR *String2, SIZE_T Count)
 
static int32 Strncmp (const UTF8CHAR *String1, const UTF8CHAR *String2, SIZE_T Count)
 
template<>
const TCHARGetEncodingTypeName ()
 
template<>
const TCHARGetEncodingTypeName ()
 
template<>
const TCHARGetEncodingTypeName ()
 
template<>
const TCHARGetEncodingTypeName ()
 
- Static Public Member Functions inherited from FGenericPlatformStricmp
static ARK_API int32 Stricmp (const ANSICHAR *String1, const ANSICHAR *String2)
 
static int32 Stricmp (const WIDECHAR *String1, const WIDECHAR *String2)
 
static ARK_API int32 Stricmp (const UTF8CHAR *String1, const UTF8CHAR *String2)
 
static ARK_API int32 Stricmp (const UTF16CHAR *String1, const UTF16CHAR *String2)
 
static ARK_API int32 Stricmp (const UTF32CHAR *String1, const UTF32CHAR *String2)
 
static ARK_API int32 Stricmp (const ANSICHAR *String1, const WIDECHAR *String2)
 
static ARK_API int32 Stricmp (const ANSICHAR *String1, const UTF8CHAR *String2)
 
static ARK_API int32 Stricmp (const ANSICHAR *String1, const UTF16CHAR *String2)
 
static ARK_API int32 Stricmp (const ANSICHAR *String1, const UTF32CHAR *String2)
 
static int32 Stricmp (const WIDECHAR *String1, const ANSICHAR *String2)
 
static ARK_API int32 Stricmp (const UTF8CHAR *String1, const ANSICHAR *String2)
 
static ARK_API int32 Stricmp (const UTF16CHAR *String1, const ANSICHAR *String2)
 
static ARK_API int32 Stricmp (const UTF32CHAR *String1, const ANSICHAR *String2)
 
static ARK_API int32 Strnicmp (const ANSICHAR *String1, const ANSICHAR *String2, SIZE_T Count)
 
static ARK_API int32 Strnicmp (const WIDECHAR *String1, const WIDECHAR *String2, SIZE_T Count)
 
static ARK_API int32 Strnicmp (const UTF8CHAR *String1, const UTF8CHAR *String2, SIZE_T Count)
 
static ARK_API int32 Strnicmp (const UTF16CHAR *String1, const UTF16CHAR *String2, SIZE_T Count)
 
static ARK_API int32 Strnicmp (const UTF32CHAR *String1, const UTF32CHAR *String2, SIZE_T Count)
 
static ARK_API int32 Strnicmp (const ANSICHAR *String1, const WIDECHAR *String2, SIZE_T Count)
 
static ARK_API int32 Strnicmp (const ANSICHAR *String1, const UTF8CHAR *String2, SIZE_T Count)
 
static ARK_API int32 Strnicmp (const ANSICHAR *String1, const UTF16CHAR *String2, SIZE_T Count)
 
static ARK_API int32 Strnicmp (const ANSICHAR *String1, const UTF32CHAR *String2, SIZE_T Count)
 
static ARK_API int32 Strnicmp (const WIDECHAR *String1, const ANSICHAR *String2, SIZE_T Count)
 
static ARK_API int32 Strnicmp (const UTF8CHAR *String1, const ANSICHAR *String2, SIZE_T Count)
 
static ARK_API int32 Strnicmp (const UTF16CHAR *String1, const ANSICHAR *String2, SIZE_T Count)
 
static ARK_API int32 Strnicmp (const UTF32CHAR *String1, const ANSICHAR *String2, SIZE_T Count)
 

Static Public Attributes

static constexpr bool IsUnicodeEncoded = true
 

Static Private Member Functions

static voidMemcpy (void *Dest, const void *Src, SIZE_T Count)
 
template<typename DestEncoding , typename SourceEncoding >
static void LogBogusChars (const SourceEncoding *Src)
 
template<typename DestEncoding , typename SourceEncoding >
static void LogBogusChars (const SourceEncoding *Src, int32 SrcSize)
 

Detailed Description

Generic string implementation for most platforms

Definition at line 60 of file GenericPlatformString.h.

Member Function Documentation

◆ CanConvertCodepoint()

static constexpr bool FGenericPlatformString::CanConvertCodepoint ( SourceEncoding Codepoint)
inlinestaticconstexpr

Tests whether a particular codepoint can be converted to the destination encoding.

Parameters
ChThe character to test.
Returns
True if Ch can be encoded as a DestEncoding.

Definition at line 102 of file GenericPlatformString.h.

◆ Convert() [1/2]

static FORCEINLINE DestEncoding * FGenericPlatformString::Convert ( DestEncoding * Dest,
int32 DestSize,
const SourceEncoding * Src )
inlinestatic

Converts the null-terminated Src string range from SourceEncoding to DestEncoding and writes it to the [Dest, Dest+DestSize) range, including a null terminator. If the Dest range is not big enough to hold the converted output, NULL is returned. In this case, nothing should be assumed about the contents of Dest.

Parameters
DestThe start of the destination buffer.
DestSizeThe size of the destination buffer.
SrcThe start of the string to convert.
Returns
A pointer to one past the last-written element.

Definition at line 196 of file GenericPlatformString.h.

◆ Convert() [2/2]

static FORCEINLINE DestEncoding * FGenericPlatformString::Convert ( DestEncoding * Dest,
int32 DestSize,
const SourceEncoding * Src,
int32 SrcSize )
inlinestatic

Converts the [Src, Src+SrcSize) string range from SourceEncoding to DestEncoding and writes it to the [Dest, Dest+DestSize) range. The Src range should contain a null terminator if a null terminator is required in the output. If the Dest range is not big enough to hold the converted output, NULL is returned. In this case, nothing should be assumed about the contents of Dest.

Parameters
DestThe start of the destination buffer.
DestSizeThe size of the destination buffer.
SrcThe start of the string to convert.
SrcSizeThe number of Src elements to convert.
Returns
A pointer to one past the last-written element.

Definition at line 292 of file GenericPlatformString.h.

◆ ConvertedLength() [1/2]

static int32 FGenericPlatformString::ConvertedLength ( const SourceEncoding * Src)
inlinestatic

Returns the required buffer length for the null-terminated Src string when converted to the DestChar encoding. The returned length includes the space for the null terminator (equivalent to strlen+1).

Parameters
SrcThe start of the string to convert.
Returns
The number of DestChar elements that Src will be converted into.

Definition at line 355 of file GenericPlatformString.h.

◆ ConvertedLength() [2/2]

static int32 FGenericPlatformString::ConvertedLength ( const SourceEncoding * Src,
int32 SrcSize )
inlinestatic

Returns the required buffer length for the [Src, Src+SrcSize) string when converted to the DestChar encoding. The Src range should contain a null terminator if a null terminator is required in the output.

Parameters
SrcThe start of the string to convert.
SrcSizeThe number of Src elements to convert.
Returns
The number of DestChar elements that Src will be converted into.

Definition at line 382 of file GenericPlatformString.h.

◆ GetEncodingName()

static const ANSICHAR * FGenericPlatformString::GetEncodingName ( )
inlinestatic

Definition at line 146 of file GenericPlatformString.h.

◆ GetEncodingTypeName() [1/5]

template<>
const TCHAR * FGenericPlatformString::GetEncodingTypeName ( )
static

Definition at line 12 of file GenericPlatformString.cpp.

◆ GetEncodingTypeName() [2/5]

template<>
const TCHAR * FGenericPlatformString::GetEncodingTypeName ( )
static

Definition at line 13 of file GenericPlatformString.cpp.

◆ GetEncodingTypeName() [3/5]

template<>
const TCHAR * FGenericPlatformString::GetEncodingTypeName ( )
static

Definition at line 14 of file GenericPlatformString.cpp.

◆ GetEncodingTypeName() [4/5]

template<>
const TCHAR * FGenericPlatformString::GetEncodingTypeName ( )
static

Definition at line 15 of file GenericPlatformString.cpp.

◆ GetEncodingTypeName() [5/5]

template<typename Encoding >
static const TCHAR * FGenericPlatformString::GetEncodingTypeName ( )
static

Returns the string representing the name of the given encoding type.

Returns
The name of the CharType as a TCHAR string.

◆ IsCharEncodingCompatibleWith()

static constexpr bool FGenericPlatformString::IsCharEncodingCompatibleWith ( )
inlinestaticconstexpr

Function which returns whether one encoding type is binary compatible with another.

Unlike TAreEncodingsCompatible, this is not commutative. For example, ANSI is compatible with UTF-8, but UTF-8 is not compatible with ANSI.

Definition at line 80 of file GenericPlatformString.h.

◆ IsCharEncodingSimplyConvertibleTo()

static constexpr bool FGenericPlatformString::IsCharEncodingSimplyConvertibleTo ( )
inlinestaticconstexpr

Tests whether you can simply (i.e. by assignment) encode code units from the source encoding as the destination encoding.

Definition at line 90 of file GenericPlatformString.h.

◆ IsFixedWidthEncoding()

template<typename Encoding >
static constexpr bool FGenericPlatformString::IsFixedWidthEncoding ( )
inlinestaticconstexpr

Tests whether an encoding has fixed-width characters

Definition at line 67 of file GenericPlatformString.h.

◆ LogBogusChars() [1/2]

static void FGenericPlatformString::LogBogusChars ( const SourceEncoding * Src)
inlinestaticprivate

Logs a message about bogus characters which were detected during string conversion.

Parameters
SrcPointer to the null-terminated string being converted.

Definition at line 422 of file GenericPlatformString.h.

◆ LogBogusChars() [2/2]

static void FGenericPlatformString::LogBogusChars ( const SourceEncoding * Src,
int32 SrcSize )
inlinestaticprivate

Logs a message about bogus characters which were detected during string conversion.

Parameters
SrcPointer to the possibly-not-null-terminated string being converted.
SrcSizeNumber of characters in the Src string.

Definition at line 432 of file GenericPlatformString.h.

◆ Memcpy()

void * FGenericPlatformString::Memcpy ( void * Dest,
const void * Src,
SIZE_T Count )
staticprivate

Forwarding function because we can't call FMemory::Memcpy directly due to #include ordering issues.

Parameters
DestThe destination buffer.
SrcThe source buffer.
CountThe number of bytes to copy.
Returns
Dest

Definition at line 20 of file GenericPlatformString.cpp.

+ Here is the call graph for this function:

◆ Strncmp() [1/9]

int32 FGenericPlatformString::Strncmp ( const ANSICHAR * String1,
const ANSICHAR * String2,
SIZE_T Count )
static

Definition at line 783 of file GenericPlatformString.cpp.

◆ Strncmp() [2/9]

int32 FGenericPlatformString::Strncmp ( const ANSICHAR * String1,
const UTF8CHAR * String2,
SIZE_T Count )
static

Definition at line 789 of file GenericPlatformString.cpp.

◆ Strncmp() [3/9]

int32 FGenericPlatformString::Strncmp ( const ANSICHAR * String1,
const WIDECHAR * String2,
SIZE_T Count )
static

Definition at line 786 of file GenericPlatformString.cpp.

◆ Strncmp() [4/9]

int32 FGenericPlatformString::Strncmp ( const UTF8CHAR * String1,
const ANSICHAR * String2,
SIZE_T Count )
static

Definition at line 785 of file GenericPlatformString.cpp.

◆ Strncmp() [5/9]

int32 FGenericPlatformString::Strncmp ( const UTF8CHAR * String1,
const UTF8CHAR * String2,
SIZE_T Count )
static

Definition at line 791 of file GenericPlatformString.cpp.

◆ Strncmp() [6/9]

int32 FGenericPlatformString::Strncmp ( const UTF8CHAR * String1,
const WIDECHAR * String2,
SIZE_T Count )
static

Definition at line 788 of file GenericPlatformString.cpp.

◆ Strncmp() [7/9]

int32 FGenericPlatformString::Strncmp ( const WIDECHAR * String1,
const ANSICHAR * String2,
SIZE_T Count )
static

Definition at line 784 of file GenericPlatformString.cpp.

◆ Strncmp() [8/9]

int32 FGenericPlatformString::Strncmp ( const WIDECHAR * String1,
const UTF8CHAR * String2,
SIZE_T Count )
static

Definition at line 790 of file GenericPlatformString.cpp.

◆ Strncmp() [9/9]

int32 FGenericPlatformString::Strncmp ( const WIDECHAR * String1,
const WIDECHAR * String2,
SIZE_T Count )
static

Definition at line 787 of file GenericPlatformString.cpp.

◆ UE_DEPRECATED() [1/2]

struct FGenericPlatformString::UE_DEPRECATED ( 5. 0,
"TAreEncodingsCompatible is deprecated,
use TIsCharEncodingCompatibleWith_V< SrcEncoding, DestEncoding > instead."  )
inline

Metafunction which tests whether two encodings are compatible.

We'll say the encodings are compatible if they're both fixed-width and have the same size. This should be good enough and catches things like UCS2CHAR and WIDECHAR being equivalent. Specializations of this template can be provided for any other special cases. Same size is a minimum requirement.

Definition at line 158 of file GenericPlatformString.h.

◆ UE_DEPRECATED() [2/2]

template<typename T >
struct FGenericPlatformString::UE_DEPRECATED ( 5. 0,
"TIsFixedWidthEncoding is deprecated,
use TIsFixedWidthCharEncoding_V< T > instead."  )
inline

Metafunction which tests whether a given character type represents a fixed-width encoding.

Definition at line 158 of file GenericPlatformString.h.

Member Data Documentation

◆ IsUnicodeEncoded

constexpr bool FGenericPlatformString::IsUnicodeEncoded = true
staticconstexpr

True if the encoding type of the string is some form of unicode

Definition at line 158 of file GenericPlatformString.h.


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