Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ASCStringHelpers Class Reference

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

#include <ASCStringHelpers.h>

List of all members.

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 144 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 157 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 170 of file ASCStringHelpers.h.


Member Function Documentation

size_t ASCStringHelpers::_ConvertToCharT charT pDest,
const NoncharT pSrc,
size_t  count
[inline, static]
 

Convert a non-native string to a native one.

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

Definition at line 470 of file ASCStringHelpers.h.

References assert.

Referenced by ASCString::ASCString().

int ASCStringHelpers::_Printf const charT format,
  ...
[inline, static]
 

Print formated string to standard output.

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

Definition at line 435 of file ASCStringHelpers.h.

References assert.

Referenced by ASCString::printf().

ASCStringHelpers::charT * ASCStringHelpers::_Strcpy charT pDest,
const charT pSrc
[inline, static]
 

Copy a string

Parameters:
pDest a pointer to a NULL-terminated string which will receive a copy of pSrc.
pSrc a 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 229 of file ASCStringHelpers.h.

References assert.

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

int ASCStringHelpers::_Stricmp const charT pS1,
const charT pS2
[inline, static]
 

Perform a lowercase comparison of strings.

Parameters:
pS1 a pointer to a NULL-terminated string.
pS2 a 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 348 of file ASCStringHelpers.h.

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

Referenced by ASCString::compare_ci().

size_t ASCStringHelpers::_Strlen const charT pS  )  [inline, static]
 

Get the length of a string.

Parameters:
pS a 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 204 of file ASCStringHelpers.h.

References assert.

Referenced by _Stricmp().

ASCStringHelpers::charT * ASCStringHelpers::_Strlwr charT pS  )  [inline, static]
 

Convert to lowercase.

Parameters:
pS a 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 253 of file ASCStringHelpers.h.

References assert.

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

ASCStringHelpers::charT * ASCStringHelpers::_Strupr charT pS  )  [inline, static]
 

Convert to uppercase.

Parameters:
pS a 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 297 of file ASCStringHelpers.h.

References assert, and strupr().

Referenced by ASCString::toUpper().

int ASCStringHelpers::_Vsnprintf charT buffer,
size_t  count,
const charT format,
std::va_list  argptr
[inline, static]
 

Write formated output.

Parameters:
buffer the storage location for output.
count the maximum number of characters to write.
format the format string.
argptr pointer 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 404 of file ASCStringHelpers.h.

References assert.

Referenced by ASCString::vaformat().


The documentation for this class was generated from the following file:
Generated on Tue Jun 24 02:16:13 2008 for Advanced Strategic Command by  doxygen 1.4.2