Advanced Strategic Command
Public Types | Static Public Member Functions | List of all members
ASCStringHelpers Class Reference

The ASCStringHelpers class provides helper's functions used by ASCString. More...

#include <ASCStringHelpers.h>

Public Types

typedef ASCCharTString::value_type charT
 
typedef
ASCAdaptatorString::value_type 
NoncharT
 

Static Public Member Functions

static size_t _Strlen (const charT *pS)
 
static charT_Strcpy (charT *pDest, const charT *pSrc)
 
static charT_Strlwr (charT *pS)
 
static charT_Strupr (charT *pS)
 
static int _Stricmp (const charT *pS1, const charT *pS2)
 
static int _Vsnprintf (charT *buffer, size_t count, const charT *format, std::va_list argptr)
 
static int _Printf (const charT *format,...)
 
static size_t _ConvertToCharT (charT *pDest, const NoncharT *pSrc, size_t count)
 

Detailed Description

The ASCStringHelpers class provides helper's functions used by ASCString.

ASCStringHelpers provides standard interfaces to utility functions across platforms and char types ( char or wchar_t ).
See Also
ASCCharTString, ASCAdaptatorString

Definition at line 146 of file ASCStringHelpers.h.

Member Typedef Documentation

typedef ASCCharTString::value_type ASCStringHelpers::charT

charT is an alias to ASCCharTString::value_type, the character type used to represent strings internally.

  • If _UNICODE is defined, charT is a wchar_t.
  • If _UNICODE is not defined, charT is a char.
See Also
ASCCharTString

Definition at line 159 of file ASCStringHelpers.h.

typedef ASCAdaptatorString::value_type ASCStringHelpers::NoncharT

NoncharT is an alias to ASCAdaptatorString::value_type, the character type used to represent complementary strings internally.

  • If _UNICODE is defined, NoncharT is a char.
  • If _UNICODE is not defined, NoncharT is a wchar_t.
See Also
ASCAdaptatorString

Definition at line 172 of file ASCStringHelpers.h.

Member Function Documentation

size_t ASCStringHelpers::_ConvertToCharT ( charT pDest,
const NoncharT pSrc,
size_t  count 
)
inlinestatic

Convert a non-native string to a native one.

Parameters
pDesta pointer to a NULL-terminated string which will receive a converted pSrc.
pSrca pointer to a NULL-terminated string which will be converted.
countthe size of the destination buffer
Returns
returns the number of characters written to pDest.

Definition at line 472 of file ASCStringHelpers.h.

Referenced by ASCString::ASCString().

int ASCStringHelpers::_Printf ( const charT format,
  ... 
)
inlinestatic

Print formated string to standard output.

Parameters
formatthe format string.
...optional arguments.
Returns
returns the number of characters printed.
Remarks
See standard system documentation for more information about printf.

Definition at line 437 of file ASCStringHelpers.h.

Referenced by ASCString::printf().

ASCStringHelpers::charT * ASCStringHelpers::_Strcpy ( charT pDest,
const charT pSrc 
)
inlinestatic

Copy a string

Parameters
pDesta pointer to a NULL-terminated string which will receive a copy of pSrc.
pSrca pointer to a NULL-terminated string which will be copied.
Returns
returns a pointer to the destination string. No return value is reserved to indicate an error.
Remarks
See standard system documentation for more information about strcpy.

Definition at line 231 of file ASCStringHelpers.h.

Referenced by _Stricmp(), ASCString::toLower(), and ASCString::toUpper().

int ASCStringHelpers::_Stricmp ( const charT pS1,
const charT pS2 
)
inlinestatic

Perform a lowercase comparison of strings.

Parameters
pS1a pointer to a NULL-terminated string.
pS2a pointer to a NULL-terminated string.
Returns
returns a value indicating the relationship between the compared strings :

< 0 pS1 less than pS2 0 pS1 identical to pS2

0 pS1 greater than pS2

Remarks
See standard system documentation for more information about stricmp.

Definition at line 350 of file ASCStringHelpers.h.

References _Strcpy(), _Strlen(), _Strlwr(), and stricmp.

Referenced by ASCString::compare_ci().

size_t ASCStringHelpers::_Strlen ( const charT pS)
inlinestatic

Get the length of a string.

Parameters
pSa pointer to a NULL-terminated string.
Returns
returns the number of characters in string, excluding the terminal NULL. No return value is reserved to indicate an error.
Remarks
See standard system documentation for more information about strlen.

Definition at line 206 of file ASCStringHelpers.h.

Referenced by _Stricmp().

ASCStringHelpers::charT * ASCStringHelpers::_Strlwr ( charT pS)
inlinestatic

Convert to lowercase.

Parameters
pSa pointer to a NULL-terminated string.
Returns
returns a pointer to the destination string. No return value is reserved to indicate an error.
Remarks
See standard system documentation for more information about strlwr.

Definition at line 255 of file ASCStringHelpers.h.

Referenced by _Stricmp(), and ASCString::toLower().

ASCStringHelpers::charT * ASCStringHelpers::_Strupr ( charT pS)
inlinestatic

Convert to uppercase.

Parameters
pSa pointer to a NULL-terminated string.
Returns
returns a pointer to the destination string. No return value is reserved to indicate an error.
Remarks
See standard system documentation for more information about strupr.

Definition at line 299 of file ASCStringHelpers.h.

References strupr().

Referenced by ASCString::toUpper().

int ASCStringHelpers::_Vsnprintf ( charT buffer,
size_t  count,
const charT format,
std::va_list  argptr 
)
inlinestatic

Write formated output.

Parameters
bufferthe storage location for output.
countthe maximum number of characters to write.
formatthe format string.
argptrpointer to a list of arguments.
Returns
returns the number of characters written.
Remarks
See standard system documentation for more information about vsnprintf.

Definition at line 406 of file ASCStringHelpers.h.

Referenced by ASCString::vaformat().


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