ReactOS 0.4.15-dev-7934-g1dc8d80
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) noexcept
 
static int __cdecl GetBaseTypeLength (_In_z_ LPCSTR pszSource) noexcept
 
static int __cdecl GetBaseTypeLength (_In_reads_(nLength) LPCWSTR pszSource, _In_ int nLength) noexcept
 
static int __cdecl GetBaseTypeLength (_In_reads_(nLength) LPCSTR pszSource, _In_ int nLength) noexcept
 
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_ LPSTR pszSource, _In_z_ LPCSTR pszSub)
 
static LPCSTR __cdecl FindString (_In_z_ LPCSTR pszSource, _In_z_ LPCSTR pszSub)
 
static LPSTR __cdecl FindChar (_In_z_ LPSTR pszSource, _In_ CHAR ch)
 
static LPCSTR __cdecl FindChar (_In_z_ LPCSTR pszSource, _In_ CHAR ch)
 
static LPSTR __cdecl FindCharReverse (_In_z_ LPSTR pszSource, _In_ CHAR ch)
 
static LPCSTR __cdecl FindCharReverse (_In_z_ LPCSTR pszSource, _In_ CHAR ch)
 
static LPSTR __cdecl FindOneOf (_In_z_ LPSTR pszSource, _In_z_ LPCSTR pszCharSet)
 
static LPCSTR __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 213 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 388 of file cstringt.h.

391 {
393 BSTR bstr = ::SysAllocStringLen(NULL, nLen);
394 if (bstr)
395 {
396 ChTraitsCRT<wchar_t>::ConvertToBaseType(bstr, nLen, pszSource, nLength);
397 }
398 return bstr;
399 }
static int __cdecl GetBaseTypeLength(_In_z_ LPCWSTR pszSource) noexcept
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
#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 340 of file cstringt.h.

343 {
344 return ::strcmp(psz1, psz2);
345 }

◆ CompareNoCase()

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

Definition at line 347 of file cstringt.h.

350 {
351 return ::_stricmp(psz1, psz2);
352 }

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

259 {
260 if (nSrcLength == -1)
261 nSrcLength = 1 + GetBaseTypeLength(pszSrc);
262
263 memcpy(pszDest, pszSrc, nSrcLength);
264 }
static int __cdecl GetBaseTypeLength(_In_z_ LPCWSTR pszSource) noexcept
Definition: cstringt.h:217
#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 242 of file cstringt.h.

247 {
248 if (nSrcLength == -1)
249 nSrcLength = 1 + GetBaseTypeLength(pszSrc);
250
251 ::WideCharToMultiByte(_AtlGetConversionACP(), 0, pszSrc, nSrcLength, pszDest, nDestLength, NULL, NULL);
252 }
#define WideCharToMultiByte
Definition: compat.h:111
UINT WINAPI _AtlGetConversionACP() noexcept
Definition: cstringt.h:14

◆ FindChar() [1/2]

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

Definition at line 307 of file cstringt.h.

310 {
311 return ::strchr(pszSource, ch);
312 }

◆ FindChar() [2/2]

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

Definition at line 301 of file cstringt.h.

304 {
305 return ::strchr(pszSource, ch);
306 }

◆ FindCharReverse() [1/2]

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

Definition at line 320 of file cstringt.h.

323 {
324 return ::strrchr(pszSource, ch);
325 }

◆ FindCharReverse() [2/2]

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

Definition at line 314 of file cstringt.h.

317 {
318 return ::strrchr(pszSource, ch);
319 }

◆ FindOneOf() [1/2]

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

Definition at line 333 of file cstringt.h.

336 {
337 return ::strpbrk(pszSource, pszCharSet);
338 }

◆ FindOneOf() [2/2]

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

Definition at line 327 of file cstringt.h.

330 {
331 return ::strpbrk(pszSource, pszCharSet);
332 }

◆ FindString() [1/2]

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

Definition at line 294 of file cstringt.h.

297 {
298 return ::strstr(pszSource, pszSub);
299 }

◆ FindString() [2/2]

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

Definition at line 288 of file cstringt.h.

291 {
292 return ::strstr(pszSource, pszSub);
293 }

◆ FormatMessageV()

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

Definition at line 379 of file cstringt.h.

380 {
381 LPSTR psz;
383 FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING, pszFormat, 0, 0, reinterpret_cast<LPSTR>(&psz),
384 0, pArgList);
385 return psz;
386 }
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 368 of file cstringt.h.

372 {
373 if (pszDest == NULL)
374 return ::_vscprintf(pszFormat, args);
375 return ::vsprintf(pszDest, pszFormat, args);
376 }
Definition: match.c:390

◆ GetBaseTypeLength() [1/4]

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

Definition at line 235 of file cstringt.h.

238 {
239 return nLength;
240 }

◆ GetBaseTypeLength() [2/4]

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

Definition at line 228 of file cstringt.h.

231 {
232 return ::WideCharToMultiByte(_AtlGetConversionACP(), 0, pszSource, nLength, NULL, 0, NULL, NULL);
233 }

◆ GetBaseTypeLength() [3/4]

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

Definition at line 222 of file cstringt.h.

223 {
224 if (pszSource == NULL) return 0;
225 return static_cast<int>(strlen(pszSource));
226 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269

◆ GetBaseTypeLength() [4/4]

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

Definition at line 217 of file cstringt.h.

218 {
219 return ::WideCharToMultiByte(_AtlGetConversionACP(), 0, pszSource, -1, NULL, 0, NULL, NULL) - 1;
220 }

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

277 {
278 return ::GetEnvironmentVariableA(pszVar, pszBuf, nBufLength);
279 }

◆ MakeLower()

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

Definition at line 266 of file cstringt.h.

269 {
270 ::CharLowerBuffA(pszSource, nSrcLength);
271 }
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 281 of file cstringt.h.

284 {
285 ::CharUpperBuffA(pszSource, nSrcLength);
286 }
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 361 of file cstringt.h.

364 {
365 return (int)::strcspn(pszBlock, pszSet);
366 }
_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 354 of file cstringt.h.

357 {
358 return (int)::strspn(pszBlock, pszSet);
359 }
_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: