ReactOS  0.4.12-dev-102-g4b7f1e0
ATL::ChTraitsCRT< char > Class Template Reference

#include <cstringt.h>

Inheritance diagram for ATL::ChTraitsCRT< char >:
Collaboration diagram for ATL::ChTraitsCRT< char >:

Static Public Member Functions

static int __cdecl GetBaseTypeLength (_In_z_ LPCWSTR pszSource) throw ()
 
static int __cdecl GetBaseTypeLength (_In_z_ LPCSTR pszSource) throw ()
 
static int __cdecl GetBaseTypeLength (_In_reads_(nLength) LPCWSTR pszSource, _In_ int nLength) throw ()
 
static int __cdecl GetBaseTypeLength (_In_reads_(nLength) LPCSTR pszSource, _In_ int nLength) throw ()
 
static void __cdecl ConvertToBaseType (_Out_writes_(nDestLength) LPSTR pszDest, _In_ int nDestLength, _In_ LPCWSTR pszSrc, _In_ int nSrcLength=-1)
 
static void __cdecl ConvertToBaseType (_Out_writes_(nDestLength) LPSTR pszDest, _In_ int nDestLength, _In_ LPCSTR pszSrc, _In_ int nSrcLength=-1)
 
static void __cdecl MakeLower (_Out_writes_(nSrcLength) LPSTR pszSource, _In_ int nSrcLength)
 
static DWORD GetEnvironmentVariable (_In_z_ LPCSTR pszVar, _Out_writes_opt_(nBufLength) LPSTR pszBuf, _In_opt_ int nBufLength)
 
static void __cdecl MakeUpper (_Out_writes_(nSrcLength) LPSTR pszSource, _In_ int nSrcLength)
 
static LPSTR __cdecl FindString (_In_z_ LPCSTR pszSource, _In_z_ LPCSTR pszSub)
 
static LPSTR __cdecl FindChar (_In_z_ LPCSTR pszSource, _In_ CHAR ch)
 
static LPSTR __cdecl FindCharReverse (_In_z_ LPCSTR pszSource, _In_ CHAR ch)
 
static LPSTR __cdecl FindOneOf (_In_z_ LPCSTR pszSource, _In_z_ LPCSTR pszCharSet)
 
static int __cdecl Compare (_In_z_ LPCSTR psz1, _In_z_ LPCSTR psz2)
 
static int __cdecl CompareNoCase (_In_z_ LPCSTR psz1, _In_z_ LPCSTR psz2)
 
static int __cdecl FormatV (_In_opt_z_ LPSTR pszDest, _In_z_ LPCSTR pszFormat, _In_ va_list args)
 
static BSTR __cdecl AllocSysString (_In_z_ LPCSTR pszSource, _In_ int nLength)
 

Additional Inherited Members

- Public Types inherited from ATL::ChTraitsBase< char >
typedef char XCHAR
 
typedef LPSTR PXSTR
 
typedef LPCSTR PCXSTR
 
typedef wchar_t YCHAR
 
typedef LPWSTR PYSTR
 
typedef LPCWSTR PCYSTR
 

Detailed Description

template<>
class ATL::ChTraitsCRT< char >

Definition at line 165 of file cstringt.h.

Member Function Documentation

◆ AllocSysString()

static BSTR __cdecl ATL::ChTraitsCRT< char >::AllocSysString ( _In_z_ LPCSTR  pszSource,
_In_ int  nLength 
)
inlinestatic

Definition at line 292 of file cstringt.h.

295  {
296  int nLen = ChTraitsCRT<wchar_t>::GetBaseTypeLength(pszSource, nLength);
297  BSTR bstr = ::SysAllocStringLen(NULL, nLen);
298  if (bstr)
299  {
300  ChTraitsCRT<wchar_t>::ConvertToBaseType(bstr, nLen, pszSource, nLength);
301  }
302  return bstr;
303  }
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:343
_In_ DWORD nLength
Definition: wincon.h:461
OLECHAR * BSTR
Definition: compat.h:1927
smooth NULL
Definition: ftsmooth.c:416
static int __cdecl GetBaseTypeLength(_In_z_ LPCWSTR pszSource)
Definition: cstringt.h:29
static void __cdecl ConvertToBaseType(_Out_writes_(nDestLength) LPWSTR pszDest, _In_ int nDestLength, _In_ LPCWSTR pszSrc, _In_ int nSrcLength=-1)
Definition: cstringt.h:55

◆ Compare()

static int __cdecl ATL::ChTraitsCRT< char >::Compare ( _In_z_ LPCSTR  psz1,
_In_z_ LPCSTR  psz2 
)
inlinestatic

Definition at line 268 of file cstringt.h.

271  {
272  return ::strcmp(psz1, psz2);
273  }
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469

◆ CompareNoCase()

static int __cdecl ATL::ChTraitsCRT< char >::CompareNoCase ( _In_z_ LPCSTR  psz1,
_In_z_ LPCSTR  psz2 
)
inlinestatic

Definition at line 275 of file cstringt.h.

278  {
279  return ::_stricmp(psz1, psz2);
280  }
#define _stricmp
Definition: cat.c:22

◆ ConvertToBaseType() [1/2]

static void __cdecl ATL::ChTraitsCRT< char >::ConvertToBaseType ( _Out_writes_(nDestLength) LPSTR  pszDest,
_In_ int  nDestLength,
_In_ LPCWSTR  pszSrc,
_In_ int  nSrcLength = -1 
)
inlinestatic

Definition at line 194 of file cstringt.h.

199  {
200  if (nSrcLength == -1)
201  nSrcLength = 1 + GetBaseTypeLength(pszSrc);
202 
203  ::WideCharToMultiByte(_AtlGetConversionACP(), 0, pszSrc, nSrcLength, pszDest, nDestLength, NULL, NULL);
204  }
#define WideCharToMultiByte
Definition: compat.h:101
smooth NULL
Definition: ftsmooth.c:416
static int __cdecl GetBaseTypeLength(_In_z_ LPCWSTR pszSource)
Definition: cstringt.h:169
UINT WINAPI _AtlGetConversionACP()
Definition: cstringt.h:14

◆ ConvertToBaseType() [2/2]

static void __cdecl ATL::ChTraitsCRT< char >::ConvertToBaseType ( _Out_writes_(nDestLength) LPSTR  pszDest,
_In_ int  nDestLength,
_In_ LPCSTR  pszSrc,
_In_ int  nSrcLength = -1 
)
inlinestatic

Definition at line 206 of file cstringt.h.

211  {
212  if (nSrcLength == -1)
213  nSrcLength = 1 + GetBaseTypeLength(pszSrc);
214 
215  memcpy(pszDest, pszSrc, nSrcLength);
216  }
static int __cdecl GetBaseTypeLength(_In_z_ LPCWSTR pszSource)
Definition: cstringt.h:169
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878

◆ FindChar()

static LPSTR __cdecl ATL::ChTraitsCRT< char >::FindChar ( _In_z_ LPCSTR  pszSource,
_In_ CHAR  ch 
)
inlinestatic

Definition at line 247 of file cstringt.h.

250  {
251  return ::strchr(pszSource, ch);
252  }
char * strchr(const char *String, int ch)
Definition: utclib.c:501

◆ FindCharReverse()

static LPSTR __cdecl ATL::ChTraitsCRT< char >::FindCharReverse ( _In_z_ LPCSTR  pszSource,
_In_ CHAR  ch 
)
inlinestatic

Definition at line 254 of file cstringt.h.

257  {
258  return ::strrchr(pszSource, ch);
259  }
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)

◆ FindOneOf()

static LPSTR __cdecl ATL::ChTraitsCRT< char >::FindOneOf ( _In_z_ LPCSTR  pszSource,
_In_z_ LPCSTR  pszCharSet 
)
inlinestatic

Definition at line 261 of file cstringt.h.

264  {
265  return ::strpbrk(pszSource, pszCharSet);
266  }
char * strpbrk(const char *String, const char *Delimiters)
Definition: utclib.c:302

◆ FindString()

static LPSTR __cdecl ATL::ChTraitsCRT< char >::FindString ( _In_z_ LPCSTR  pszSource,
_In_z_ LPCSTR  pszSub 
)
inlinestatic

Definition at line 240 of file cstringt.h.

243  {
244  return ::strstr(pszSource, pszSub);
245  }
char * strstr(char *String1, char *String2)
Definition: utclib.c:653

◆ FormatV()

static int __cdecl ATL::ChTraitsCRT< char >::FormatV ( _In_opt_z_ LPSTR  pszDest,
_In_z_ LPCSTR  pszFormat,
_In_ va_list  args 
)
inlinestatic

Definition at line 282 of file cstringt.h.

286  {
287  if (pszDest == NULL)
288  return ::_vscprintf(pszFormat, args);
289  return ::vsprintf(pszDest, pszFormat, args);
290  }
Definition: match.c:390
smooth NULL
Definition: ftsmooth.c:416
_Check_return_ _CRTIMP int __cdecl _vscprintf(_In_z_ _Printf_format_string_ const char *_Format, va_list _ArgList)
int __cdecl vsprintf(char *_Dest, const char *_Format, va_list _Args)
Definition: sprintf.c:733

◆ GetBaseTypeLength() [1/4]

static int __cdecl ATL::ChTraitsCRT< char >::GetBaseTypeLength ( _In_z_ LPCWSTR  pszSource)
throw (
)
inlinestatic

Definition at line 169 of file cstringt.h.

170  {
171  return ::WideCharToMultiByte(_AtlGetConversionACP(), 0, pszSource, -1, NULL, 0, NULL, NULL) - 1;
172  }
#define WideCharToMultiByte
Definition: compat.h:101
smooth NULL
Definition: ftsmooth.c:416
UINT WINAPI _AtlGetConversionACP()
Definition: cstringt.h:14

◆ GetBaseTypeLength() [2/4]

static int __cdecl ATL::ChTraitsCRT< char >::GetBaseTypeLength ( _In_z_ LPCSTR  pszSource)
throw (
)
inlinestatic

Definition at line 174 of file cstringt.h.

175  {
176  if (pszSource == NULL) return 0;
177  return static_cast<int>(strlen(pszSource));
178  }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
smooth NULL
Definition: ftsmooth.c:416

◆ GetBaseTypeLength() [3/4]

static int __cdecl ATL::ChTraitsCRT< char >::GetBaseTypeLength ( _In_reads_(nLength) LPCWSTR  pszSource,
_In_ int  nLength 
)
throw (
)
inlinestatic

Definition at line 180 of file cstringt.h.

183  {
185  }
#define WideCharToMultiByte
Definition: compat.h:101
_In_ DWORD nLength
Definition: wincon.h:461
smooth NULL
Definition: ftsmooth.c:416
UINT WINAPI _AtlGetConversionACP()
Definition: cstringt.h:14

◆ GetBaseTypeLength() [4/4]

static int __cdecl ATL::ChTraitsCRT< char >::GetBaseTypeLength ( _In_reads_(nLength) LPCSTR  pszSource,
_In_ int  nLength 
)
throw (
)
inlinestatic

Definition at line 187 of file cstringt.h.

190  {
191  return nLength;
192  }
_In_ DWORD nLength
Definition: wincon.h:461

◆ GetEnvironmentVariable()

static DWORD ATL::ChTraitsCRT< char >::GetEnvironmentVariable ( _In_z_ LPCSTR  pszVar,
_Out_writes_opt_(nBufLength) LPSTR  pszBuf,
_In_opt_ int  nBufLength 
)
inlinestatic

Definition at line 225 of file cstringt.h.

229  {
230  return ::GetEnvironmentVariableA(pszVar, pszBuf, nBufLength);
231  }
#define GetEnvironmentVariableA(x, y, z)
Definition: compat.h:411

◆ MakeLower()

static void __cdecl ATL::ChTraitsCRT< char >::MakeLower ( _Out_writes_(nSrcLength) LPSTR  pszSource,
_In_ int  nSrcLength 
)
inlinestatic

Definition at line 218 of file cstringt.h.

221  {
222  ::CharLowerBuffA(pszSource, nSrcLength);
223  }
DWORD WINAPI CharLowerBuffA(_Inout_updates_(cchLength) LPSTR lpsz, _In_ DWORD cchLength)

◆ MakeUpper()

static void __cdecl ATL::ChTraitsCRT< char >::MakeUpper ( _Out_writes_(nSrcLength) LPSTR  pszSource,
_In_ int  nSrcLength 
)
inlinestatic

Definition at line 233 of file cstringt.h.

236  {
237  ::CharUpperBuffA(pszSource, nSrcLength);
238  }
DWORD WINAPI CharUpperBuffA(_Inout_updates_(cchLength) LPSTR lpsz, _In_ DWORD cchLength)

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