Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
TCString< T > Struct Template Reference

#include <CString.h>

Public Types

typedef T CharType
 

Public Member Functions

FORCEINLINE bool IsPureAnsi (const WIDECHAR *Str)
 

Static Public Member Functions

static FORCEINLINE bool IsPureAnsi (const CharType *Str)
 
static bool IsNumeric (const CharType *Str)
 
static FORCEINLINE CharTypeStrcpy (CharType *Dest, SIZE_T DestCount, const CharType *Src)
 
static FORCEINLINE CharTypeStrncpy (CharType *Dest, const CharType *Src, int32 MaxLen)
 
template<SIZE_T DestCount>
static FORCEINLINE CharTypeStrcpy (CharType(&Dest)[DestCount], const CharType *Src)
 
static FORCEINLINE CharTypeStrcat (CharType *Dest, SIZE_T DestCount, const CharType *Src)
 
template<SIZE_T DestCount>
static FORCEINLINE CharTypeStrcat (CharType(&Dest)[DestCount], const CharType *Src)
 
static CharTypeStrncat (CharType *Dest, const CharType *Src, int32 MaxLen)
 
static FORCEINLINE CharTypeStrupr (CharType *Dest, SIZE_T DestCount)
 
template<SIZE_T DestCount>
static FORCEINLINE CharTypeStrupr (CharType(&Dest)[DestCount])
 
static FORCEINLINE int32 Strcmp (const CharType *String1, const CharType *String2)
 
static FORCEINLINE int32 Strncmp (const CharType *String1, const CharType *String2, SIZE_T Count)
 
static FORCEINLINE int32 Stricmp (const CharType *String1, const CharType *String2)
 
static FORCEINLINE int32 Strnicmp (const CharType *String1, const CharType *String2, SIZE_T Count)
 
static const CharTypeSpc (int32 NumSpaces)
 
static const CharTypeTab (int32 NumTabs)
 
static const CharTypeStrfind (const CharType *Str, const CharType *Find)
 
static const CharTypeStrifind (const CharType *Str, const CharType *Find)
 
static const CharTypeStrfindDelim (const CharType *Str, const CharType *Find, const CharType *Delim=LITERAL(CharType, " \t,"))
 
static const CharTypeStristr (const CharType *Str, const CharType *Find)
 
static CharTypeStristr (CharType *Str, const CharType *Find)
 
static FORCEINLINE int32 Strlen (const CharType *String)
 
static FORCEINLINE const CharTypeStrstr (const CharType *String, const CharType *Find)
 
static FORCEINLINE CharTypeStrstr (CharType *String, const CharType *Find)
 
static FORCEINLINE const CharTypeStrchr (const CharType *String, CharType c)
 
static FORCEINLINE CharTypeStrchr (CharType *String, CharType c)
 
static FORCEINLINE const CharTypeStrrchr (const CharType *String, CharType c)
 
static FORCEINLINE CharTypeStrrchr (CharType *String, CharType c)
 
static FORCEINLINE const CharTypeStrrstr (const CharType *String, const CharType *Find)
 
static FORCEINLINE CharTypeStrrstr (CharType *String, const CharType *Find)
 
static FORCEINLINE int32 Strspn (const CharType *String, const CharType *Mask)
 
static FORCEINLINE int32 Strcspn (const CharType *String, const CharType *Mask)
 
static FORCEINLINE int32 Atoi (const CharType *String)
 
static FORCEINLINE int64 Atoi64 (const CharType *String)
 
static FORCEINLINE float Atof (const CharType *String)
 
static FORCEINLINE double Atod (const CharType *String)
 
static FORCEINLINE bool ToBool (const CharType *String)
 
static FORCEINLINE int32 Strtoi (const CharType *Start, CharType **End, int32 Base)
 
static FORCEINLINE int64 Strtoi64 (const CharType *Start, CharType **End, int32 Base)
 
static FORCEINLINE uint64 Strtoui64 (const CharType *Start, CharType **End, int32 Base)
 
static FORCEINLINE CharTypeStrtok (CharType *TokenString, const CharType *Delim, CharType **Context)
 
static FORCEINLINE int32 GetVarArgs (CharType *Dest, SIZE_T DestSize, int32 Count, const CharType *&Fmt, va_list ArgPtr)
 

Detailed Description

template<typename T>
struct TCString< T >

Set of basic string utility functions operating on plain C strings. In addition to the wrapped C string API,this struct also contains a set of widely used utility functions that operate on c strings. There is a specialized implementation for ANSICHAR and WIDECHAR strings provided. To access these functionality, the convenience typedefs FCString and FCStringAnsi are provided.

Definition at line 16 of file CString.h.

Member Typedef Documentation

◆ CharType

template<typename T >
typedef T TCString< T >::CharType

Definition at line 18 of file CString.h.

Member Function Documentation

◆ Atod()

template<typename T >
FORCEINLINE double TCString< T >::Atod ( const CharType * String)
static

atod wrapper

Definition at line 722 of file CString.h.

+ Here is the caller graph for this function:

◆ Atof()

template<typename T >
FORCEINLINE float TCString< T >::Atof ( const CharType * String)
static

atof wrapper

Definition at line 715 of file CString.h.

+ Here is the caller graph for this function:

◆ Atoi()

template<typename T >
FORCEINLINE int32 TCString< T >::Atoi ( const CharType * String)
static

atoi wrapper

Definition at line 701 of file CString.h.

+ Here is the caller graph for this function:

◆ Atoi64()

template<typename T >
FORCEINLINE int64 TCString< T >::Atoi64 ( const CharType * String)
static

atoi64 wrapper

Definition at line 708 of file CString.h.

+ Here is the caller graph for this function:

◆ GetVarArgs()

template<typename T >
FORCEINLINE int32 TCString< T >::GetVarArgs ( CharType * Dest,
SIZE_T DestSize,
int32 Count,
const CharType *& Fmt,
va_list ArgPtr )
static

Helper function to write formatted output using an argument list

Parameters
Dest- destination string buffer
DestSize- size of destination buffer
Count- number of characters to write (not including null terminating character)
Fmt- string to print
Args- argument list
Returns
number of characters written or -1 if truncated

Definition at line 758 of file CString.h.

◆ IsNumeric()

template<typename T >
static bool TCString< T >::IsNumeric ( const CharType * Str)
inlinestatic

Returns whether this string contains only numeric characters

Parameters
Str- string that will be checked

Definition at line 30 of file CString.h.

+ Here is the call graph for this function:

◆ IsPureAnsi() [1/2]

template<typename T >
static FORCEINLINE bool TCString< T >::IsPureAnsi ( const CharType * Str)
static

Returns whether this string contains only pure ansi characters

Parameters
Str- string that will be checked

◆ IsPureAnsi() [2/2]

FORCEINLINE bool TCString< WIDECHAR >::IsPureAnsi ( const WIDECHAR * Str)

Definition at line 769 of file CString.h.

◆ Spc()

template<typename T >
const TCString< T >::CharType * TCString< T >::Spc ( int32 NumSpaces)
static

Returns a static string that is filled with a variable number of spaces

Parameters
NumSpacesNumber of spaces to put into the string, max of 255
Returns
The string of NumSpaces spaces.

Definition at line 354 of file CString.h.

◆ Strcat() [1/2]

template<typename T >
FORCEINLINE TCString< T >::CharType * TCString< T >::Strcat ( CharType * Dest,
SIZE_T DestCount,
const CharType * Src )
static

strcat wrapper

Parameters
Dest- destination string to copy to
Destcount- size of Dest in characters
Src- source string
Returns
destination string

Definition at line 535 of file CString.h.

◆ Strcat() [2/2]

template<typename T >
template<SIZE_T DestCount>
static FORCEINLINE CharType * TCString< T >::Strcat ( CharType(&) Dest[DestCount],
const CharType * Src )
inlinestatic

strcat wrapper (templated version to automatically handle static destination array case)

Parameters
Dest- destination string to copy to
Src- source string
Returns
destination string

Definition at line 112 of file CString.h.

◆ Strchr() [1/2]

template<typename T >
FORCEINLINE TCString< T >::CharType * TCString< T >::Strchr ( CharType * String,
CharType c )
static

Definition at line 605 of file CString.h.

◆ Strchr() [2/2]

template<typename T >
FORCEINLINE const TCString< T >::CharType * TCString< T >::Strchr ( const CharType * String,
CharType c )
static

strchr wrapper

Definition at line 598 of file CString.h.

◆ Strcmp()

template<typename T >
FORCEINLINE int32 TCString< T >::Strcmp ( const CharType * String1,
const CharType * String2 )
static

strcmp wrapper

Definition at line 549 of file CString.h.

+ Here is the caller graph for this function:

◆ Strcpy() [1/2]

template<typename T >
FORCEINLINE TCString< T >::CharType * TCString< T >::Strcpy ( CharType * Dest,
SIZE_T DestCount,
const CharType * Src )
static

strcpy wrapper

Parameters
Dest- destination string to copy to
Destcount- size of Dest in characters
Src- source string
Returns
destination string

Definition at line 520 of file CString.h.

◆ Strcpy() [2/2]

template<typename T >
template<SIZE_T DestCount>
static FORCEINLINE CharType * TCString< T >::Strcpy ( CharType(&) Dest[DestCount],
const CharType * Src )
inlinestatic

strcpy wrapper (templated version to automatically handle static destination array case)

Parameters
Dest- destination string to copy to
Src- source string
Returns
destination string

Definition at line 88 of file CString.h.

◆ Strcspn()

template<typename T >
FORCEINLINE int32 TCString< T >::Strcspn ( const CharType * String,
const CharType * Mask )
static

strcspn wrapper

Definition at line 680 of file CString.h.

◆ Strfind()

template<typename T >
const TCString< T >::CharType * TCString< T >::Strfind ( const CharType * Str,
const CharType * Find )
static

Find string in string, case sensitive, requires non-alphanumeric lead-in.

Definition at line 370 of file CString.h.

◆ StrfindDelim()

template<typename T >
const TCString< T >::CharType * TCString< T >::StrfindDelim ( const CharType * Str,
const CharType * Find,
const CharType * Delim = LITERAL(CharType, " \t,") )
static

Finds string in string, case insensitive, requires the string be surrounded by one the specified delimiters, or the start or end of the string.

Definition at line 434 of file CString.h.

◆ Stricmp()

template<typename T >
FORCEINLINE int32 TCString< T >::Stricmp ( const CharType * String1,
const CharType * String2 )
static

stricmp wrapper

Definition at line 563 of file CString.h.

+ Here is the caller graph for this function:

◆ Strifind()

template<typename T >
const TCString< T >::CharType * TCString< T >::Strifind ( const CharType * Str,
const CharType * Find )
static

Find string in string, case insensitive, requires non-alphanumeric lead-in.

Definition at line 399 of file CString.h.

◆ Stristr() [1/2]

template<typename T >
static CharType * TCString< T >::Stristr ( CharType * Str,
const CharType * Find )
inlinestatic

Finds string in string, case insensitive (non-const version)

Parameters
StrThe string to look through
FindThe string to find inside Str
Returns
Position in Str if Find was found, otherwise, NULL

Definition at line 228 of file CString.h.

+ Here is the caller graph for this function:

◆ Stristr() [2/2]

template<typename T >
const TCString< T >::CharType * TCString< T >::Stristr ( const CharType * Str,
const CharType * Find )
static

Finds string in string, case insensitive

Parameters
StrThe string to look through
FindThe string to find inside Str
Returns
Position in Str if Find was found, otherwise, NULL

Definition at line 485 of file CString.h.

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

◆ Strlen()

template<typename T >
FORCEINLINE int32 TCString< T >::Strlen ( const CharType * String)
static

strlen wrapper

Definition at line 577 of file CString.h.

+ Here is the caller graph for this function:

◆ Strncat()

template<typename T >
static CharType * TCString< T >::Strncat ( CharType * Dest,
const CharType * Src,
int32 MaxLen )
inlinestatic

Concatenate a string with length checking.

Parameters
Dest- destination buffer to append to
Src- source buffer to copy from
MaxLen- max length of the buffer
Returns
pointer to resulting string buffer

Definition at line 125 of file CString.h.

◆ Strncmp()

template<typename T >
FORCEINLINE int32 TCString< T >::Strncmp ( const CharType * String1,
const CharType * String2,
SIZE_T Count )
static

strncmp wrapper

Definition at line 556 of file CString.h.

+ Here is the caller graph for this function:

◆ Strncpy()

template<typename T >
FORCEINLINE TCString< T >::CharType * TCString< T >::Strncpy ( CharType * Dest,
const CharType * Src,
int32 MaxLen )
static

Copy a string with length checking. Behavior differs from strncpy in that last character is zeroed.

Parameters
Dest- destination buffer to copy to
Src- source buffer to copy from
MaxLen- max length of the buffer (including null-terminator)
Returns
pointer to resulting string buffer

Definition at line 527 of file CString.h.

◆ Strnicmp()

template<typename T >
FORCEINLINE int32 TCString< T >::Strnicmp ( const CharType * String1,
const CharType * String2,
SIZE_T Count )
static

strnicmp wrapper

Definition at line 570 of file CString.h.

+ Here is the caller graph for this function:

◆ Strrchr() [1/2]

template<typename T >
FORCEINLINE TCString< T >::CharType * TCString< T >::Strrchr ( CharType * String,
CharType c )
static

Definition at line 619 of file CString.h.

◆ Strrchr() [2/2]

template<typename T >
FORCEINLINE const TCString< T >::CharType * TCString< T >::Strrchr ( const CharType * String,
CharType c )
static

strrchr wrapper

Definition at line 612 of file CString.h.

◆ Strrstr() [1/2]

template<typename T >
FORCEINLINE TCString< T >::CharType * TCString< T >::Strrstr ( CharType * String,
const CharType * Find )
static

Definition at line 633 of file CString.h.

◆ Strrstr() [2/2]

template<typename T >
FORCEINLINE const TCString< T >::CharType * TCString< T >::Strrstr ( const CharType * String,
const CharType * Find )
static

strrstr wrapper

Definition at line 626 of file CString.h.

◆ Strspn()

template<typename T >
FORCEINLINE int32 TCString< T >::Strspn ( const CharType * String,
const CharType * Mask )
static

strspn wrapper

Definition at line 656 of file CString.h.

◆ Strstr() [1/2]

template<typename T >
FORCEINLINE TCString< T >::CharType * TCString< T >::Strstr ( CharType * String,
const CharType * Find )
static

Definition at line 591 of file CString.h.

+ Here is the caller graph for this function:

◆ Strstr() [2/2]

template<typename T >
FORCEINLINE const TCString< T >::CharType * TCString< T >::Strstr ( const CharType * String,
const CharType * Find )
static

strstr wrapper

Definition at line 584 of file CString.h.

+ Here is the caller graph for this function:

◆ Strtoi()

template<typename T >
FORCEINLINE int32 TCString< T >::Strtoi ( const CharType * Start,
CharType ** End,
int32 Base )
static

strtoi wrapper

Definition at line 729 of file CString.h.

+ Here is the caller graph for this function:

◆ Strtoi64()

template<typename T >
FORCEINLINE int64 TCString< T >::Strtoi64 ( const CharType * Start,
CharType ** End,
int32 Base )
static

strtoi wrapper

Definition at line 736 of file CString.h.

◆ Strtok()

template<typename T >
FORCEINLINE TCString< T >::CharType * TCString< T >::Strtok ( CharType * TokenString,
const CharType * Delim,
CharType ** Context )
static

strtok wrapper

Definition at line 751 of file CString.h.

◆ Strtoui64()

template<typename T >
FORCEINLINE uint64 TCString< T >::Strtoui64 ( const CharType * Start,
CharType ** End,
int32 Base )
static

strtoui wrapper

Definition at line 743 of file CString.h.

+ Here is the caller graph for this function:

◆ Strupr() [1/2]

template<typename T >
FORCEINLINE TCString< T >::CharType * TCString< T >::Strupr ( CharType * Dest,
SIZE_T DestCount )
static

strupr wrapper

Parameters
Dest- destination string to convert
Destcount- size of Dest in characters
Returns
destination string

Definition at line 542 of file CString.h.

◆ Strupr() [2/2]

template<typename T >
template<SIZE_T DestCount>
static FORCEINLINE CharType * TCString< T >::Strupr ( CharType(&) Dest[DestCount])
inlinestatic

strupr wrapper (templated version to automatically handle static destination array case)

Parameters
Dest- destination string to convert
Returns
destination string

Definition at line 154 of file CString.h.

◆ Tab()

template<typename T >
const TCString< T >::CharType * TCString< T >::Tab ( int32 NumTabs)
static

Returns a static string that is filled with a variable number of tabs

Parameters
NumTabsNumber of tabs to put into the string, max of 255
Returns
The string of NumTabs tabs.

Definition at line 361 of file CString.h.

◆ ToBool()

template<typename T >
static FORCEINLINE bool TCString< T >::ToBool ( const CharType * String)
static

Converts a string into a boolean value 1, "True", "Yes", GTrue, GYes, and non-zero integers become true 0, "False", "No", GFalse, GNo, and unparsable values become false

Returns
The boolean value

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