ReactOS  0.4.12-dev-18-gf469aca
ATL::ChTraitsCRT< _CharType > Class Template Reference

#include <cstringt.h>

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

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) LPWSTR pszDest, _In_ int nDestLength, _In_ LPCWSTR pszSrc, _In_ int nSrcLength=-1)
 
static void __cdecl ConvertToBaseType (_Out_writes_(nDestLength) LPWSTR pszDest, _In_ int nDestLength, _In_ LPCSTR pszSrc, _In_ int nSrcLength=-1)
 
static void __cdecl MakeLower (_Out_writes_(nSrcLength) LPWSTR pszSource, _In_ int nSrcLength)
 
static DWORD GetEnvironmentVariable (_In_z_ LPCWSTR pszVar, _Out_writes_opt_(nBufLength) LPWSTR pszBuf, _In_opt_ int nBufLength)
 
static void __cdecl MakeUpper (_Out_writes_(nSrcLength) LPWSTR pszSource, _In_ int nSrcLength)
 
static LPWSTR __cdecl FindString (_In_z_ LPCWSTR pszSource, _In_z_ LPCWSTR pszSub)
 
static LPWSTR __cdecl FindChar (_In_z_ LPCWSTR pszSource, _In_ WCHAR ch)
 
static LPWSTR __cdecl FindCharReverse (_In_z_ LPCWSTR pszSource, _In_ WCHAR ch)
 
static LPWSTR __cdecl FindOneOf (_In_z_ LPCWSTR pszSource, _In_z_ LPCWSTR pszCharSet)
 
static int __cdecl Compare (_In_z_ LPCWSTR psz1, _In_z_ LPCWSTR psz2)
 
static int __cdecl CompareNoCase (_In_z_ LPCWSTR psz1, _In_z_ LPCWSTR psz2)
 
static int __cdecl FormatV (_In_opt_z_ LPWSTR pszDest, _In_z_ LPCWSTR pszFormat, _In_ va_list args)
 
static BSTR __cdecl AllocSysString (_In_z_ LPCWSTR pszSource, _In_ int nLength)
 

Additional Inherited Members

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

Detailed Description

template<typename _CharType = wchar_t>
class ATL::ChTraitsCRT< _CharType >

Definition at line 25 of file cstringt.h.

Member Function Documentation

◆ AllocSysString()

template<typename _CharType = wchar_t>
static BSTR __cdecl ATL::ChTraitsCRT< _CharType >::AllocSysString ( _In_z_ LPCWSTR  pszSource,
_In_ int  nLength 
)
inlinestatic

Definition at line 153 of file cstringt.h.

156  {
158  }
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:343
_In_ DWORD nLength
Definition: wincon.h:461

◆ Compare()

template<typename _CharType = wchar_t>
static int __cdecl ATL::ChTraitsCRT< _CharType >::Compare ( _In_z_ LPCWSTR  psz1,
_In_z_ LPCWSTR  psz2 
)
inlinestatic

Definition at line 129 of file cstringt.h.

132  {
133  return ::wcscmp(psz1, psz2);
134  }
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)

◆ CompareNoCase()

template<typename _CharType = wchar_t>
static int __cdecl ATL::ChTraitsCRT< _CharType >::CompareNoCase ( _In_z_ LPCWSTR  psz1,
_In_z_ LPCWSTR  psz2 
)
inlinestatic

Definition at line 136 of file cstringt.h.

139  {
140  return ::_wcsicmp(psz1, psz2);
141  }
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)

◆ ConvertToBaseType() [1/2]

template<typename _CharType = wchar_t>
static void __cdecl ATL::ChTraitsCRT< _CharType >::ConvertToBaseType ( _Out_writes_(nDestLength) LPWSTR  pszDest,
_In_ int  nDestLength,
_In_ LPCWSTR  pszSrc,
_In_ int  nSrcLength = -1 
)
inlinestatic

Definition at line 55 of file cstringt.h.

Referenced by ATL::ChTraitsCRT< char >::AllocSysString().

60  {
61  if (nSrcLength == -1)
62  nSrcLength = 1 + GetBaseTypeLength(pszSrc);
63 
64  wmemcpy(pszDest, pszSrc, nSrcLength);
65  }
static int __cdecl GetBaseTypeLength(_In_z_ LPCWSTR pszSource)
Definition: cstringt.h:29

◆ ConvertToBaseType() [2/2]

template<typename _CharType = wchar_t>
static void __cdecl ATL::ChTraitsCRT< _CharType >::ConvertToBaseType ( _Out_writes_(nDestLength) LPWSTR  pszDest,
_In_ int  nDestLength,
_In_ LPCSTR  pszSrc,
_In_ int  nSrcLength = -1 
)
inlinestatic

Definition at line 67 of file cstringt.h.

72  {
73  if (nSrcLength == -1)
74  nSrcLength = 1 + GetBaseTypeLength(pszSrc);
75 
76  ::MultiByteToWideChar(_AtlGetConversionACP(), 0, pszSrc, nSrcLength, pszDest, nDestLength);
77  }
static int __cdecl GetBaseTypeLength(_In_z_ LPCWSTR pszSource)
Definition: cstringt.h:29
UINT WINAPI _AtlGetConversionACP()
Definition: cstringt.h:14
#define MultiByteToWideChar
Definition: compat.h:100

◆ FindChar()

template<typename _CharType = wchar_t>
static LPWSTR __cdecl ATL::ChTraitsCRT< _CharType >::FindChar ( _In_z_ LPCWSTR  pszSource,
_In_ WCHAR  ch 
)
inlinestatic

Definition at line 108 of file cstringt.h.

111  {
112  return ::wcschr(pszSource, ch);
113  }
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)

◆ FindCharReverse()

template<typename _CharType = wchar_t>
static LPWSTR __cdecl ATL::ChTraitsCRT< _CharType >::FindCharReverse ( _In_z_ LPCWSTR  pszSource,
_In_ WCHAR  ch 
)
inlinestatic

Definition at line 115 of file cstringt.h.

118  {
119  return ::wcsrchr(pszSource, ch);
120  }
_Check_return_ _CRTIMP _CONST_RETURN wchar_t *__cdecl wcsrchr(_In_z_ const wchar_t *_Str, _In_ wchar_t _Ch)

◆ FindOneOf()

template<typename _CharType = wchar_t>
static LPWSTR __cdecl ATL::ChTraitsCRT< _CharType >::FindOneOf ( _In_z_ LPCWSTR  pszSource,
_In_z_ LPCWSTR  pszCharSet 
)
inlinestatic

Definition at line 122 of file cstringt.h.

125  {
126  return ::wcspbrk(pszSource, pszCharSet);
127  }
_Check_return_ _CRTIMP _CONST_RETURN wchar_t *__cdecl wcspbrk(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_Control)

◆ FindString()

template<typename _CharType = wchar_t>
static LPWSTR __cdecl ATL::ChTraitsCRT< _CharType >::FindString ( _In_z_ LPCWSTR  pszSource,
_In_z_ LPCWSTR  pszSub 
)
inlinestatic

Definition at line 101 of file cstringt.h.

104  {
105  return ::wcsstr(pszSource, pszSub);
106  }
_CONST_RETURN wchar_t *__cdecl wcsstr(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_SubStr)

◆ FormatV()

template<typename _CharType = wchar_t>
static int __cdecl ATL::ChTraitsCRT< _CharType >::FormatV ( _In_opt_z_ LPWSTR  pszDest,
_In_z_ LPCWSTR  pszFormat,
_In_ va_list  args 
)
inlinestatic

Definition at line 143 of file cstringt.h.

Referenced by ATL::CStringT< BaseType, StringTraits >::Format().

147  {
148  if (pszDest == NULL)
149  return ::_vscwprintf(pszFormat, args);
150  return ::vswprintf(pszDest, pszFormat, args);
151  }
Definition: match.c:390
smooth NULL
Definition: ftsmooth.c:416
_Check_return_ _CRTIMP int __cdecl _vscwprintf(_In_z_ _Printf_format_string_ const wchar_t *_Format, va_list _ArgList)
_CRTIMP int __cdecl vswprintf(_Out_ wchar_t *, const wchar_t *, va_list)

◆ GetBaseTypeLength() [1/4]

template<typename _CharType = wchar_t>
static int __cdecl ATL::ChTraitsCRT< _CharType >::GetBaseTypeLength ( _In_z_ LPCWSTR  pszSource)
throw (
)
inlinestatic

Definition at line 29 of file cstringt.h.

Referenced by ATL::ChTraitsCRT< char >::AllocSysString(), ATL::ChTraitsCRT< _CharType >::ConvertToBaseType(), and ATL::ChTraitsCRT< char >::ConvertToBaseType().

30  {
31  if (pszSource == NULL) return -1;
32  return static_cast<int>(wcslen(pszSource));
33  }
smooth NULL
Definition: ftsmooth.c:416
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

◆ GetBaseTypeLength() [2/4]

template<typename _CharType = wchar_t>
static int __cdecl ATL::ChTraitsCRT< _CharType >::GetBaseTypeLength ( _In_z_ LPCSTR  pszSource)
throw (
)
inlinestatic

Definition at line 35 of file cstringt.h.

36  {
37  if (pszSource == NULL) return 0;
38  return ::MultiByteToWideChar(_AtlGetConversionACP(), 0, pszSource, -1, NULL, 0) - 1;
39  }
smooth NULL
Definition: ftsmooth.c:416
UINT WINAPI _AtlGetConversionACP()
Definition: cstringt.h:14
#define MultiByteToWideChar
Definition: compat.h:100

◆ GetBaseTypeLength() [3/4]

template<typename _CharType = wchar_t>
static int __cdecl ATL::ChTraitsCRT< _CharType >::GetBaseTypeLength ( _In_reads_(nLength) LPCWSTR  pszSource,
_In_ int  nLength 
)
throw (
)
inlinestatic

Definition at line 41 of file cstringt.h.

44  {
45  return nLength;
46  }
_In_ DWORD nLength
Definition: wincon.h:461

◆ GetBaseTypeLength() [4/4]

template<typename _CharType = wchar_t>
static int __cdecl ATL::ChTraitsCRT< _CharType >::GetBaseTypeLength ( _In_reads_(nLength) LPCSTR  pszSource,
_In_ int  nLength 
)
throw (
)
inlinestatic

Definition at line 48 of file cstringt.h.

51  {
53  }
_In_ DWORD nLength
Definition: wincon.h:461
smooth NULL
Definition: ftsmooth.c:416
UINT WINAPI _AtlGetConversionACP()
Definition: cstringt.h:14
#define MultiByteToWideChar
Definition: compat.h:100

◆ GetEnvironmentVariable()

template<typename _CharType = wchar_t>
static DWORD ATL::ChTraitsCRT< _CharType >::GetEnvironmentVariable ( _In_z_ LPCWSTR  pszVar,
_Out_writes_opt_(nBufLength) LPWSTR  pszBuf,
_In_opt_ int  nBufLength 
)
inlinestatic

Definition at line 86 of file cstringt.h.

90  {
91  return ::GetEnvironmentVariableW(pszVar, pszBuf, nBufLength);
92  }
#define GetEnvironmentVariableW(x, y, z)
Definition: compat.h:412

◆ MakeLower()

template<typename _CharType = wchar_t>
static void __cdecl ATL::ChTraitsCRT< _CharType >::MakeLower ( _Out_writes_(nSrcLength) LPWSTR  pszSource,
_In_ int  nSrcLength 
)
inlinestatic

Definition at line 79 of file cstringt.h.

82  {
83  ::CharLowerBuffW(pszSource, nSrcLength);
84  }
DWORD WINAPI CharLowerBuffW(_Inout_updates_(cchLength) LPWSTR lpsz, _In_ DWORD cchLength)

◆ MakeUpper()

template<typename _CharType = wchar_t>
static void __cdecl ATL::ChTraitsCRT< _CharType >::MakeUpper ( _Out_writes_(nSrcLength) LPWSTR  pszSource,
_In_ int  nSrcLength 
)
inlinestatic

Definition at line 94 of file cstringt.h.

97  {
98  ::CharUpperBuffW(pszSource, nSrcLength);
99  }
DWORD WINAPI CharUpperBuffW(_Inout_updates_(cchLength) LPWSTR lpsz, _In_ DWORD cchLength)

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