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

#include <GenericPlatformString.h>

+ Inheritance diagram for FGenericPlatformString:

Classes

struct  TAreEncodingsCompatible
 
struct  TIsFixedWidthEncoding
 
struct  TIsFixedWidthEncoding_Helper
 
struct  TIsFixedWidthEncoding_Helper< Dummy, ANSICHAR >
 
struct  TIsFixedWidthEncoding_Helper< Dummy, UCS2CHAR >
 
struct  TIsFixedWidthEncoding_Helper< Dummy, WIDECHAR >
 

Static Public Member Functions

template<typename Encoding >
static bool IsValidChar (Encoding Ch)
 
template<typename DestEncoding , typename SourceEncoding >
static bool CanConvertChar (SourceEncoding Ch)
 
template<typename Encoding >
static const TCHARGetEncodingTypeName ()
 
template<typename SourceEncoding , typename DestEncoding >
static TEnableIf< TAreEncodingsCompatible< SourceEncoding, DestEncoding >::Value, DestEncoding * >::Type Convert (DestEncoding *Dest, int32 DestSize, const SourceEncoding *Src, int32 SrcSize, DestEncoding BogusChar=(DestEncoding)'?')
 
template<typename SourceEncoding , typename DestEncoding >
static TEnableIf<!TAreEncodingsCompatible< SourceEncoding, DestEncoding >::Value &&TIsFixedWidthEncoding< SourceEncoding >::Value, DestEncoding * >::Type Convert (DestEncoding *Dest, int32 DestSize, const SourceEncoding *Src, int32 SrcSize, DestEncoding BogusChar=(DestEncoding)'?')
 
template<typename DestEncoding , typename SourceEncoding >
static TEnableIf< TIsFixedWidthEncoding< SourceEncoding >::Value &&TIsFixedWidthEncoding< DestEncoding >::Value, int32 >::Type ConvertedLength (const SourceEncoding *Src, int32 SrcSize)
 
template<>
bool IsValidChar (ANSICHAR Ch)
 
template<>
const TCHARGetEncodingTypeName ()
 
template<>
const TCHARGetEncodingTypeName ()
 
template<>
const TCHARGetEncodingTypeName ()
 

Static Public Attributes

static const bool IsUnicodeEncoded = false
 

Static Private Member Functions

static void * Memcpy (void *Dest, const void *Src, SIZE_T Count)
 

Detailed Description

Generic string implementation for most platforms

Definition at line 12 of file GenericPlatformString.h.

Member Function Documentation

◆ CanConvertChar()

template<typename DestEncoding , typename SourceEncoding >
static bool FGenericPlatformString::CanConvertChar ( SourceEncoding Ch)
inlinestatic

Tests whether a particular character 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 34 of file GenericPlatformString.h.

◆ Convert() [1/2]

template<typename SourceEncoding , typename DestEncoding >
static TEnableIf< TAreEncodingsCompatible< SourceEncoding, DestEncoding >::Value, DestEncoding * >::Type FGenericPlatformString::Convert ( DestEncoding * Dest,
int32 DestSize,
const SourceEncoding * Src,
int32 SrcSize,
DestEncoding BogusChar = (DestEncoding)'?' )
inlinestatic

Converts the [Src, Src+SrcSize) string range from SourceChar to DestChar 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.
BogusCharThe char to use when the conversion process encounters a character it cannot convert.
Returns
A pointer to one past the last-written element.

Definition at line 108 of file GenericPlatformString.h.

◆ Convert() [2/2]

template<typename SourceEncoding , typename DestEncoding >
static TEnableIf<!TAreEncodingsCompatible< SourceEncoding, DestEncoding >::Value &&TIsFixedWidthEncoding< SourceEncoding >::Value, DestEncoding * >::Type FGenericPlatformString::Convert ( DestEncoding * Dest,
int32 DestSize,
const SourceEncoding * Src,
int32 SrcSize,
DestEncoding BogusChar = (DestEncoding)'?' )
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.
BogusCharThe char to use when the conversion process encounters a character it cannot convert.
Returns
A pointer to one past the last-written element.

Definition at line 133 of file GenericPlatformString.h.

◆ ConvertedLength()

template<typename DestEncoding , typename SourceEncoding >
static TEnableIf< TIsFixedWidthEncoding< SourceEncoding >::Value &&TIsFixedWidthEncoding< DestEncoding >::Value, int32 >::Type 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 169 of file GenericPlatformString.h.

◆ GetEncodingTypeName() [1/4]

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.

◆ GetEncodingTypeName() [2/4]

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

Definition at line 198 of file GenericPlatformString.h.

◆ GetEncodingTypeName() [3/4]

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

Definition at line 200 of file GenericPlatformString.h.

◆ GetEncodingTypeName() [4/4]

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

Definition at line 202 of file GenericPlatformString.h.

◆ IsValidChar() [1/2]

template<>
bool FGenericPlatformString::IsValidChar ( ANSICHAR Ch)
inlinestatic

Specialization of IsValidChar for ANSICHARs.

Definition at line 192 of file GenericPlatformString.h.

◆ IsValidChar() [2/2]

template<typename Encoding >
static bool FGenericPlatformString::IsValidChar ( Encoding Ch)
inlinestatic

Tests whether a particular character is a valid member of its encoding.

Parameters
ChThe character to test.
Returns
True if the character is a valid member of Encoding.

Definition at line 21 of file GenericPlatformString.h.

◆ Memcpy()

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

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 205 of file GenericPlatformString.h.

+ Here is the call graph for this function:

Member Data Documentation

◆ IsUnicodeEncoded

const bool FGenericPlatformString::IsUnicodeEncoded = false
static

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

Definition at line 51 of file GenericPlatformString.h.


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