ReactOS  0.4.15-dev-3441-g67ad4e7
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 StringSpanIncluding (_In_z_ LPCSTR pszBlock, _In_z_ LPCSTR pszSet)
 
static int __cdecl StringSpanExcluding (_In_z_ LPCSTR pszBlock, _In_z_ LPCSTR pszSet)
 
static int __cdecl FormatV (_In_opt_z_ LPSTR pszDest, _In_z_ LPCSTR pszFormat, _In_ va_list args)
 
static LPSTR FormatMessageV (_In_z_ LPCSTR pszFormat, _In_opt_ va_list *pArgList)
 
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 189 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 340 of file cstringt.h.

343  {
344  int nLen = ChTraitsCRT<wchar_t>::GetBaseTypeLength(pszSource, nLength);
345  BSTR bstr = ::SysAllocStringLen(NULL, nLen);
346  if (bstr)
347  {
348  ChTraitsCRT<wchar_t>::ConvertToBaseType(bstr, nLen, pszSource, nLength);
349  }
350  return bstr;
351  }
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
_In_ DWORD nLength
Definition: wincon.h:473
OLECHAR * BSTR
Definition: compat.h:2152
static int __cdecl GetBaseTypeLength(_In_z_ LPCWSTR pszSource)
Definition: cstringt.h:29
#define NULL
Definition: types.h:112
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 292 of file cstringt.h.

295  {
296  return ::strcmp(psz1, psz2);
297  }
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 299 of file cstringt.h.

302  {
303  return ::_stricmp(psz1, psz2);
304  }
#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 218 of file cstringt.h.

223  {
224  if (nSrcLength == -1)
225  nSrcLength = 1 + GetBaseTypeLength(pszSrc);
226 
227  ::WideCharToMultiByte(_AtlGetConversionACP(), 0, pszSrc, nSrcLength, pszDest, nDestLength, NULL, NULL);
228  }
#define WideCharToMultiByte
Definition: compat.h:111
static int __cdecl GetBaseTypeLength(_In_z_ LPCWSTR pszSource)
Definition: cstringt.h:193
UINT WINAPI _AtlGetConversionACP()
Definition: cstringt.h:14
#define NULL
Definition: types.h:112

◆ 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 230 of file cstringt.h.

235  {
236  if (nSrcLength == -1)
237  nSrcLength = 1 + GetBaseTypeLength(pszSrc);
238 
239  memcpy(pszDest, pszSrc, nSrcLength);
240  }
static int __cdecl GetBaseTypeLength(_In_z_ LPCWSTR pszSource)
Definition: cstringt.h:193
#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 271 of file cstringt.h.

274  {
275  return ::strchr(pszSource, ch);
276  }
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 278 of file cstringt.h.

281  {
282  return ::strrchr(pszSource, ch);
283  }
_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 285 of file cstringt.h.

288  {
289  return ::strpbrk(pszSource, pszCharSet);
290  }
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 264 of file cstringt.h.

267  {
268  return ::strstr(pszSource, pszSub);
269  }
char * strstr(char *String1, char *String2)
Definition: utclib.c:653

◆ FormatMessageV()

static LPSTR ATL::ChTraitsCRT< char >::FormatMessageV ( _In_z_ LPCSTR  pszFormat,
_In_opt_ va_list pArgList 
)
inlinestatic

Definition at line 331 of file cstringt.h.

332  {
333  LPSTR psz;
335  FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING, pszFormat, 0, 0, reinterpret_cast<LPSTR>(&psz),
336  0, pArgList);
337  return psz;
338  }
#define FORMAT_MESSAGE_FROM_STRING
Definition: winbase.h:418
DWORD WINAPI FormatMessageA(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:483
char * LPSTR
Definition: xmlstorage.h:182
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:416

◆ 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 320 of file cstringt.h.

324  {
325  if (pszDest == NULL)
326  return ::_vscprintf(pszFormat, args);
327  return ::vsprintf(pszDest, pszFormat, args);
328  }
Definition: match.c:390
_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
#define NULL
Definition: types.h:112

◆ GetBaseTypeLength() [1/4]

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

Definition at line 193 of file cstringt.h.

194  {
195  return ::WideCharToMultiByte(_AtlGetConversionACP(), 0, pszSource, -1, NULL, 0, NULL, NULL) - 1;
196  }
#define WideCharToMultiByte
Definition: compat.h:111
UINT WINAPI _AtlGetConversionACP()
Definition: cstringt.h:14
#define NULL
Definition: types.h:112

◆ GetBaseTypeLength() [2/4]

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

Definition at line 198 of file cstringt.h.

199  {
200  if (pszSource == NULL) return 0;
201  return static_cast<int>(strlen(pszSource));
202  }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
return static_cast< int >(global)
#define NULL
Definition: types.h:112

◆ GetBaseTypeLength() [3/4]

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

Definition at line 204 of file cstringt.h.

207  {
209  }
#define WideCharToMultiByte
Definition: compat.h:111
_In_ DWORD nLength
Definition: wincon.h:473
UINT WINAPI _AtlGetConversionACP()
Definition: cstringt.h:14
#define NULL
Definition: types.h:112

◆ GetBaseTypeLength() [4/4]

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

Definition at line 211 of file cstringt.h.

214  {
215  return nLength;
216  }
_In_ DWORD nLength
Definition: wincon.h:473

◆ 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 249 of file cstringt.h.

253  {
254  return ::GetEnvironmentVariableA(pszVar, pszBuf, nBufLength);
255  }
#define GetEnvironmentVariableA(x, y, z)
Definition: compat.h:613

◆ MakeLower()

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

Definition at line 242 of file cstringt.h.

245  {
246  ::CharLowerBuffA(pszSource, nSrcLength);
247  }
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 257 of file cstringt.h.

260  {
261  ::CharUpperBuffA(pszSource, nSrcLength);
262  }
DWORD WINAPI CharUpperBuffA(_Inout_updates_(cchLength) LPSTR lpsz, _In_ DWORD cchLength)

◆ StringSpanExcluding()

static int __cdecl ATL::ChTraitsCRT< char >::StringSpanExcluding ( _In_z_ LPCSTR  pszBlock,
_In_z_ LPCSTR  pszSet 
)
inlinestatic

Definition at line 313 of file cstringt.h.

316  {
317  return (int)::strcspn(pszBlock, pszSet);
318  }
_Check_return_ _CRTIMP size_t __cdecl strcspn(_In_z_ const char *_Str, _In_z_ const char *_Control)

◆ StringSpanIncluding()

static int __cdecl ATL::ChTraitsCRT< char >::StringSpanIncluding ( _In_z_ LPCSTR  pszBlock,
_In_z_ LPCSTR  pszSet 
)
inlinestatic

Definition at line 306 of file cstringt.h.

309  {
310  return (int)::strspn(pszBlock, pszSet);
311  }
_Check_return_ _CRTIMP size_t __cdecl strspn(_In_z_ const char *_Str, _In_z_ const char *_Control)

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