ReactOS 0.4.15-dev-6073-g59e7458
ATL::ChTraitsCRT< char > Class 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

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

◆ 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 }

◆ 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 }

◆ ConvertToBaseType() [1/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

◆ ConvertToBaseType() [2/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
UINT WINAPI _AtlGetConversionACP()
Definition: cstringt.h:14

◆ 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 }

◆ 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 }

◆ 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 }

◆ 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 }

◆ 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 }
DWORD WINAPI FormatMessageA(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:483
#define FORMAT_MESSAGE_FROM_STRING
Definition: winbase.h:421
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:419
char * LPSTR
Definition: xmlstorage.h:182

◆ 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

◆ GetBaseTypeLength() [1/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 }

◆ GetBaseTypeLength() [2/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 {
208 return ::WideCharToMultiByte(_AtlGetConversionACP(), 0, pszSource, nLength, NULL, 0, NULL, NULL);
209 }

◆ GetBaseTypeLength() [3/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

◆ GetBaseTypeLength() [4/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 }

◆ 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 }

◆ 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: