ReactOS  0.4.15-dev-1054-gd029a62
ATL::CStringT< BaseType, StringTraits > Class Template Reference

#include <cstringt.h>

Inheritance diagram for ATL::CStringT< BaseType, StringTraits >:
Collaboration diagram for ATL::CStringT< BaseType, StringTraits >:

Public Types

typedef CSimpleStringT< BaseType, _CSTRING_IMPL_::_MFCDLLTraitsCheck< BaseType, StringTraits >::c_bIsMFCDLLTraits > CThisSimpleString
 
typedef StringTraits StrTraits
 
typedef CThisSimpleString::XCHAR XCHAR
 
typedef CThisSimpleString::PXSTR PXSTR
 
typedef CThisSimpleString::PCXSTR PCXSTR
 
typedef CThisSimpleString::YCHAR YCHAR
 
typedef CThisSimpleString::PYSTR PYSTR
 
typedef CThisSimpleString::PCYSTR PCYSTR
 
- Public Types inherited from ATL::CSimpleStringT< BaseType, _CSTRING_IMPL_::_MFCDLLTraitsCheck< BaseType, StringTraits >::c_bIsMFCDLLTraits >
typedef ChTraitsBase< BaseType >::XCHAR XCHAR
 
typedef ChTraitsBase< BaseType >::PXSTR PXSTR
 
typedef ChTraitsBase< BaseType >::PCXSTR PCXSTR
 
typedef ChTraitsBase< BaseType >::YCHAR YCHAR
 
typedef ChTraitsBase< BaseType >::PYSTR PYSTR
 
typedef ChTraitsBase< BaseType >::PCYSTR PCYSTR
 

Public Member Functions

 CStringT () throw ()
 
 CStringT (_In_ IAtlStringMgr *pStringMgr) throw ()
 
 CStringT (_In_ const CStringT &strSrc)
 
 CStringT (_In_ const CThisSimpleString &strSrc)
 
template<class StringTraits_ >
 CStringT (_In_ const CStringT< YCHAR, StringTraits_ > &strSrc)
 
 CStringT (_In_opt_z_ const XCHAR *pszSrc)
 
 CStringT (_In_opt_z_ const XCHAR *pszSrc, _In_ IAtlStringMgr *pStringMgr)
 
 CStringT (_In_opt_z_ const YCHAR *pszSrc)
 
 CStringT (_In_opt_z_ const YCHAR *pszSrc, _In_ IAtlStringMgr *pStringMgr)
 
 CStringT (_In_reads_z_(nLength) const XCHAR *pch, _In_ int nLength)
 
 CStringT (_In_reads_z_(nLength) const YCHAR *pch, _In_ int nLength)
 
CStringToperator= (_In_ const CStringT &strSrc)
 
CStringToperator= (_In_opt_z_ PCXSTR pszSrc)
 
CStringToperator= (_In_opt_z_ PCYSTR pszSrc)
 
CStringToperator= (_In_ const CThisSimpleString &strSrc)
 
CStringToperator+= (_In_ const CThisSimpleString &str)
 
CStringToperator+= (_In_z_ PCXSTR pszSrc)
 
CStringToperator+= (_In_ XCHAR ch)
 
BOOL LoadString (_In_ UINT nID)
 
_Check_return_ BOOL LoadString (_In_ HINSTANCE hInstance, _In_ UINT nID)
 
BOOL GetEnvironmentVariable (_In_z_ PCXSTR pszVar)
 
CStringTMakeLower ()
 
CStringTMakeUpper ()
 
int Find (_In_ PCXSTR pszSub, _In_opt_ int iStart=0) const throw ()
 
int Find (_In_ XCHAR ch, _In_opt_ int iStart=0) const throw ()
 
int FindOneOf (_In_ PCXSTR pszCharSet) const throw ()
 
int ReverseFind (_In_ XCHAR ch) const throw ()
 
int Compare (_In_z_ PCXSTR psz) const
 
int CompareNoCase (_In_z_ PCXSTR psz) const
 
CStringT Mid (int iFirst, int nCount) const
 
CStringT Mid (int iFirst) const
 
CStringT Left (int nCount) const
 
CStringT Right (int nCount) const
 
void __cdecl Format (UINT nFormatID,...)
 
void __cdecl Format (PCXSTR pszFormat,...)
 
void FormatV (PCXSTR pszFormat, va_list args)
 
void __cdecl FormatMessage (UINT nFormatID,...)
 
void __cdecl FormatMessage (PCXSTR pszFormat,...)
 
void FormatMessageV (PCXSTR pszFormat, va_list *pArgList)
 
int Replace (PCXSTR pszOld, PCXSTR pszNew)
 
int Replace (XCHAR chOld, XCHAR chNew)
 
CStringT Tokenize (_In_z_ PCXSTR pszTokens, _Inout_ int &iStart) const
 
CStringTTrimLeft ()
 
CStringTTrimLeft (XCHAR chTarget)
 
CStringTTrimLeft (PCXSTR pszTargets)
 
CStringTTrimRight ()
 
CStringTTrimRight (XCHAR chTarget)
 
CStringTTrimRight (PCXSTR pszTargets)
 
CStringTTrim ()
 
CStringTTrim (XCHAR chTarget)
 
CStringTTrim (PCXSTR pszTargets)
 
BSTR AllocSysString () const
 
- Public Member Functions inherited from ATL::CSimpleStringT< BaseType, _CSTRING_IMPL_::_MFCDLLTraitsCheck< BaseType, StringTraits >::c_bIsMFCDLLTraits >
 CSimpleStringT (_Inout_ IAtlStringMgr *pStringMgr)
 
 CSimpleStringT (_In_ const CSimpleStringT &strSrc)
 
 CSimpleStringT (_In_z_ PCXSTR pszSrc, _Inout_ IAtlStringMgr *pStringMgr)
 
 CSimpleStringT (_In_count_(nLength) const XCHAR *pchSrc, _In_ int nLength, _Inout_ IAtlStringMgr *pStringMgr)
 
 ~CSimpleStringT () throw ()
 
CSimpleStringToperator= (_In_opt_z_ PCXSTR pszSrc)
 
CSimpleStringToperator= (_In_ const CSimpleStringT &strSrc)
 
CSimpleStringToperator+= (_In_ const CSimpleStringT &strSrc)
 
CSimpleStringToperator+= (_In_z_ PCXSTR pszSrc)
 
CSimpleStringToperator+= (XCHAR ch)
 
 operator PCXSTR () const throw ()
 
void Empty () throw ()
 
void Append (_In_count_(nLength) PCXSTR pszSrc, _In_ int nLength)
 
void Append (_In_z_ PCXSTR pszSrc)
 
void Append (_In_ const CSimpleStringT &strSrc)
 
void SetString (_In_opt_z_ PCXSTR pszSrc)
 
void SetString (_In_reads_opt_(nLength) PCXSTR pszSrc, _In_ int nLength)
 
PXSTR GetBuffer ()
 
_Ret_notnull_ _Post_writable_size_ (nMinBufferLength+1) PXSTR GetBuffer(_In_ int nMinBufferLength)
 
int GetAllocLength () const throw ()
 
int GetLength () const throw ()
 
PCXSTR GetString () const throw ()
 
void ReleaseBufferSetLength (_In_ int nNewLength)
 
void ReleaseBuffer (_In_ int nNewLength=-1)
 
bool IsEmpty () const throw ()
 
CStringDataGetData () const throw ()
 
IAtlStringMgrGetManager () const throw ()
 

Static Public Member Functions

static void __cdecl Construct (_In_ CStringT *pString)
 
static PCXSTR DefaultTrimChars ()
 
- Static Public Member Functions inherited from ATL::CSimpleStringT< BaseType, _CSTRING_IMPL_::_MFCDLLTraitsCheck< BaseType, StringTraits >::c_bIsMFCDLLTraits >
static void __cdecl CopyChars (_Out_writes_to_(nDestLen, nChars) XCHAR *pchDest, _In_ size_t nDestLen, _In_reads_opt_(nChars) const XCHAR *pchSrc, _In_ int nChars) throw ()
 
static void __cdecl CopyCharsOverlapped (_Out_writes_to_(nDestLen, nDestLen) XCHAR *pchDest, _In_ size_t nDestLen, _In_reads_(nChars) const XCHAR *pchSrc, _In_ int nChars) throw ()
 
static int __cdecl StringLength (_In_opt_z_ const char *psz) throw ()
 
static int __cdecl StringLength (_In_opt_z_ const wchar_t *psz) throw ()
 

Protected Member Functions

template<typename T_CHAR >
void LoadFromPtr_ (_In_opt_z_ const T_CHAR *pszSrc)
 

Friends

bool operator== (const CStringT &str1, const CStringT &str2) throw ()
 
bool operator== (const CStringT &str1, PCXSTR psz2) throw ()
 
bool operator== (const CStringT &str1, PCYSTR psz2) throw ()
 
bool operator== (const CStringT &str1, XCHAR ch2) throw ()
 
bool operator== (PCXSTR psz1, const CStringT &str2) throw ()
 
bool operator== (PCYSTR psz1, const CStringT &str2) throw ()
 
bool operator== (XCHAR ch1, const CStringT &str2) throw ()
 

Additional Inherited Members

- Static Protected Member Functions inherited from ATL::CSimpleStringT< BaseType, _CSTRING_IMPL_::_MFCDLLTraitsCheck< BaseType, StringTraits >::c_bIsMFCDLLTraits >
static void __cdecl Concatenate (_Inout_ CSimpleStringT &strResult, _In_count_(nLength1) PCXSTR psz1, _In_ int nLength1, _In_count_(nLength2) PCXSTR psz2, _In_ int nLength2)
 
static void ThrowMemoryException ()
 
static void ThrowInvalidArgException ()
 

Detailed Description

template<typename BaseType, class StringTraits>
class ATL::CStringT< BaseType, StringTraits >

Definition at line 369 of file cstringt.h.

Member Typedef Documentation

◆ CThisSimpleString

template<typename BaseType , class StringTraits >
typedef CSimpleStringT<BaseType, _CSTRING_IMPL_::_MFCDLLTraitsCheck<BaseType, StringTraits>::c_bIsMFCDLLTraits> ATL::CStringT< BaseType, StringTraits >::CThisSimpleString

Definition at line 373 of file cstringt.h.

◆ PCXSTR

template<typename BaseType , class StringTraits >
typedef CThisSimpleString::PCXSTR ATL::CStringT< BaseType, StringTraits >::PCXSTR

Definition at line 377 of file cstringt.h.

◆ PCYSTR

template<typename BaseType , class StringTraits >
typedef CThisSimpleString::PCYSTR ATL::CStringT< BaseType, StringTraits >::PCYSTR

Definition at line 380 of file cstringt.h.

◆ PXSTR

template<typename BaseType , class StringTraits >
typedef CThisSimpleString::PXSTR ATL::CStringT< BaseType, StringTraits >::PXSTR

Definition at line 376 of file cstringt.h.

◆ PYSTR

template<typename BaseType , class StringTraits >
typedef CThisSimpleString::PYSTR ATL::CStringT< BaseType, StringTraits >::PYSTR

Definition at line 379 of file cstringt.h.

◆ StrTraits

template<typename BaseType , class StringTraits >
typedef StringTraits ATL::CStringT< BaseType, StringTraits >::StrTraits

Definition at line 374 of file cstringt.h.

◆ XCHAR

template<typename BaseType , class StringTraits >
typedef CThisSimpleString::XCHAR ATL::CStringT< BaseType, StringTraits >::XCHAR

Definition at line 375 of file cstringt.h.

◆ YCHAR

template<typename BaseType , class StringTraits >
typedef CThisSimpleString::YCHAR ATL::CStringT< BaseType, StringTraits >::YCHAR

Definition at line 378 of file cstringt.h.

Constructor & Destructor Documentation

◆ CStringT() [1/11]

template<typename BaseType , class StringTraits >
ATL::CStringT< BaseType, StringTraits >::CStringT ( )
throw (
)
inline

Definition at line 383 of file cstringt.h.

383  :
384  CThisSimpleString(StringTraits::GetDefaultManager())
385  {
386  }
CSimpleStringT< BaseType, _CSTRING_IMPL_::_MFCDLLTraitsCheck< BaseType, StringTraits >::c_bIsMFCDLLTraits > CThisSimpleString
Definition: cstringt.h:373

Referenced by ATL::CStringT< BaseType, StringTraits >::Left(), ATL::CStringT< BaseType, StringTraits >::Mid(), ATL::CStringT< BaseType, StringTraits >::Right(), and ATL::CStringT< BaseType, StringTraits >::Tokenize().

◆ CStringT() [2/11]

template<typename BaseType , class StringTraits >
ATL::CStringT< BaseType, StringTraits >::CStringT ( _In_ IAtlStringMgr pStringMgr)
throw (
)
inlineexplicit

Definition at line 388 of file cstringt.h.

388  :
389  CThisSimpleString(pStringMgr)
390  {
391  }
CSimpleStringT< BaseType, _CSTRING_IMPL_::_MFCDLLTraitsCheck< BaseType, StringTraits >::c_bIsMFCDLLTraits > CThisSimpleString
Definition: cstringt.h:373

◆ CStringT() [3/11]

template<typename BaseType , class StringTraits >
ATL::CStringT< BaseType, StringTraits >::CStringT ( _In_ const CStringT< BaseType, StringTraits > &  strSrc)
inline

Definition at line 398 of file cstringt.h.

398  :
399  CThisSimpleString(strSrc)
400  {
401  }
CSimpleStringT< BaseType, _CSTRING_IMPL_::_MFCDLLTraitsCheck< BaseType, StringTraits >::c_bIsMFCDLLTraits > CThisSimpleString
Definition: cstringt.h:373

◆ CStringT() [4/11]

template<typename BaseType , class StringTraits >
ATL::CStringT< BaseType, StringTraits >::CStringT ( _In_ const CThisSimpleString strSrc)
inline

Definition at line 403 of file cstringt.h.

403  :
404  CThisSimpleString(strSrc)
405  {
406  }
CSimpleStringT< BaseType, _CSTRING_IMPL_::_MFCDLLTraitsCheck< BaseType, StringTraits >::c_bIsMFCDLLTraits > CThisSimpleString
Definition: cstringt.h:373

◆ CStringT() [5/11]

template<typename BaseType , class StringTraits >
template<class StringTraits_ >
ATL::CStringT< BaseType, StringTraits >::CStringT ( _In_ const CStringT< YCHAR, StringTraits_ > &  strSrc)
inline

Definition at line 409 of file cstringt.h.

409  :
410  CThisSimpleString(StringTraits::GetDefaultManager())
411  {
412  *this = static_cast<const YCHAR*>(strSrc);
413  }
CSimpleStringT< BaseType, _CSTRING_IMPL_::_MFCDLLTraitsCheck< BaseType, StringTraits >::c_bIsMFCDLLTraits > CThisSimpleString
Definition: cstringt.h:373

◆ CStringT() [6/11]

template<typename BaseType , class StringTraits >
ATL::CStringT< BaseType, StringTraits >::CStringT ( _In_opt_z_ const XCHAR pszSrc)
inline

Definition at line 429 of file cstringt.h.

429  :
430  CThisSimpleString(StringTraits::GetDefaultManager())
431  {
432  LoadFromPtr_(pszSrc);
433  }
CSimpleStringT< BaseType, _CSTRING_IMPL_::_MFCDLLTraitsCheck< BaseType, StringTraits >::c_bIsMFCDLLTraits > CThisSimpleString
Definition: cstringt.h:373
void LoadFromPtr_(_In_opt_z_ const T_CHAR *pszSrc)
Definition: cstringt.h:418

◆ CStringT() [7/11]

template<typename BaseType , class StringTraits >
ATL::CStringT< BaseType, StringTraits >::CStringT ( _In_opt_z_ const XCHAR pszSrc,
_In_ IAtlStringMgr pStringMgr 
)
inline

Definition at line 435 of file cstringt.h.

436  : CThisSimpleString(pStringMgr)
437  {
438  LoadFromPtr_(pszSrc);
439  }
CSimpleStringT< BaseType, _CSTRING_IMPL_::_MFCDLLTraitsCheck< BaseType, StringTraits >::c_bIsMFCDLLTraits > CThisSimpleString
Definition: cstringt.h:373
void LoadFromPtr_(_In_opt_z_ const T_CHAR *pszSrc)
Definition: cstringt.h:418

◆ CStringT() [8/11]

template<typename BaseType , class StringTraits >
ATL::CStringT< BaseType, StringTraits >::CStringT ( _In_opt_z_ const YCHAR pszSrc)
inline

Definition at line 441 of file cstringt.h.

441  :
442  CThisSimpleString(StringTraits::GetDefaultManager())
443  {
444  LoadFromPtr_(pszSrc);
445  }
CSimpleStringT< BaseType, _CSTRING_IMPL_::_MFCDLLTraitsCheck< BaseType, StringTraits >::c_bIsMFCDLLTraits > CThisSimpleString
Definition: cstringt.h:373
void LoadFromPtr_(_In_opt_z_ const T_CHAR *pszSrc)
Definition: cstringt.h:418

◆ CStringT() [9/11]

template<typename BaseType , class StringTraits >
ATL::CStringT< BaseType, StringTraits >::CStringT ( _In_opt_z_ const YCHAR pszSrc,
_In_ IAtlStringMgr pStringMgr 
)
inline

Definition at line 447 of file cstringt.h.

448  : CThisSimpleString(pStringMgr)
449  {
450  LoadFromPtr_(pszSrc);
451  }
CSimpleStringT< BaseType, _CSTRING_IMPL_::_MFCDLLTraitsCheck< BaseType, StringTraits >::c_bIsMFCDLLTraits > CThisSimpleString
Definition: cstringt.h:373
void LoadFromPtr_(_In_opt_z_ const T_CHAR *pszSrc)
Definition: cstringt.h:418

◆ CStringT() [10/11]

template<typename BaseType , class StringTraits >
ATL::CStringT< BaseType, StringTraits >::CStringT ( _In_reads_z_(nLength) const XCHAR pch,
_In_ int  nLength 
)
inline

Definition at line 453 of file cstringt.h.

454  :
455  CThisSimpleString(pch, nLength, StringTraits::GetDefaultManager())
456  {
457  }
_In_ DWORD nLength
Definition: wincon.h:476
#define pch(ap)
Definition: match.c:418
CSimpleStringT< BaseType, _CSTRING_IMPL_::_MFCDLLTraitsCheck< BaseType, StringTraits >::c_bIsMFCDLLTraits > CThisSimpleString
Definition: cstringt.h:373

◆ CStringT() [11/11]

template<typename BaseType , class StringTraits >
ATL::CStringT< BaseType, StringTraits >::CStringT ( _In_reads_z_(nLength) const YCHAR pch,
_In_ int  nLength 
)
inline

Definition at line 459 of file cstringt.h.

460  :
461  CThisSimpleString(pch, nLength, StringTraits::GetDefaultManager())
462  {
463  }
_In_ DWORD nLength
Definition: wincon.h:476
#define pch(ap)
Definition: match.c:418
CSimpleStringT< BaseType, _CSTRING_IMPL_::_MFCDLLTraitsCheck< BaseType, StringTraits >::c_bIsMFCDLLTraits > CThisSimpleString
Definition: cstringt.h:373

Member Function Documentation

◆ AllocSysString()

template<typename BaseType , class StringTraits >
BSTR ATL::CStringT< BaseType, StringTraits >::AllocSysString ( ) const
inline

◆ Compare()

template<typename BaseType , class StringTraits >
int ATL::CStringT< BaseType, StringTraits >::Compare ( _In_z_ PCXSTR  psz) const
inline

◆ CompareNoCase()

template<typename BaseType , class StringTraits >
int ATL::CStringT< BaseType, StringTraits >::CompareNoCase ( _In_z_ PCXSTR  psz) const
inline

Definition at line 658 of file cstringt.h.

Referenced by CFontCache::Filename().

◆ Construct()

template<typename BaseType , class StringTraits >
static void __cdecl ATL::CStringT< BaseType, StringTraits >::Construct ( _In_ CStringT< BaseType, StringTraits > *  pString)
inlinestatic

Definition at line 393 of file cstringt.h.

394  {
395  new(pString) CStringT;
396  }

◆ DefaultTrimChars()

template<typename BaseType , class StringTraits >
static PCXSTR ATL::CStringT< BaseType, StringTraits >::DefaultTrimChars ( )
inlinestatic

Definition at line 871 of file cstringt.h.

872  {
873  static XCHAR str[] = { ' ', '\t', '\r', '\n', 0 };
874  return str;
875  }
const WCHAR * str
CThisSimpleString::XCHAR XCHAR
Definition: cstringt.h:375

Referenced by ATL::CStringT< BaseType, StringTraits >::Trim(), ATL::CStringT< BaseType, StringTraits >::TrimLeft(), and ATL::CStringT< BaseType, StringTraits >::TrimRight().

◆ Find() [1/2]

template<typename BaseType , class StringTraits >
int ATL::CStringT< BaseType, StringTraits >::Find ( _In_ PCXSTR  pszSub,
_In_opt_ int  iStart = 0 
) const
throw (
)
inline

Definition at line 611 of file cstringt.h.

612  {
614 
615  if (iStart >= nLength || iStart < 0)
616  return -1;
617 
619  PCXSTR pszResult = StringTraits::FindString(pszString + iStart, pszSub);
620 
621  return pszResult ? ((int)(pszResult - pszString)) : -1;
622  }
_In_ DWORD nLength
Definition: wincon.h:476
_In_ UINT iStart
Definition: wingdi.h:3619
CThisSimpleString::PCXSTR PCXSTR
Definition: cstringt.h:377
static int FindString(IN FILE *pStream, IN PCWSTR pszFilePath OPTIONAL, IN PCWSTR pszSearchString)
Definition: find.c:106
_In_ DWORD _In_ DWORD _Out_writes_to_opt_ pcchString LPSTR pszString
Definition: wincrypt.h:4505
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

Referenced by CACLCustomMRU::Initialize().

◆ Find() [2/2]

template<typename BaseType , class StringTraits >
int ATL::CStringT< BaseType, StringTraits >::Find ( _In_ XCHAR  ch,
_In_opt_ int  iStart = 0 
) const
throw (
)
inline

Definition at line 624 of file cstringt.h.

625  {
627 
628  if (iStart >= nLength || iStart < 0)
629  return -1;
630 
632  PCXSTR pszResult = StringTraits::FindChar(pszString + iStart, ch);
633 
634  return pszResult ? ((int)(pszResult - pszString)) : -1;
635  }
_In_ DWORD nLength
Definition: wincon.h:476
_In_ UINT iStart
Definition: wingdi.h:3619
CThisSimpleString::PCXSTR PCXSTR
Definition: cstringt.h:377
_In_ DWORD _In_ DWORD _Out_writes_to_opt_ pcchString LPSTR pszString
Definition: wincrypt.h:4505
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

◆ FindOneOf()

template<typename BaseType , class StringTraits >
int ATL::CStringT< BaseType, StringTraits >::FindOneOf ( _In_ PCXSTR  pszCharSet) const
throw (
)
inline

Definition at line 637 of file cstringt.h.

638  {
640  PCXSTR pszResult = StringTraits::FindOneOf(pszString, pszCharSet);
641 
642  return pszResult ? ((int)(pszResult - pszString)) : -1;
643  }
CThisSimpleString::PCXSTR PCXSTR
Definition: cstringt.h:377
_In_ DWORD _In_ DWORD _Out_writes_to_opt_ pcchString LPSTR pszString
Definition: wincrypt.h:4505
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

◆ Format() [1/2]

template<typename BaseType , class StringTraits >
void __cdecl ATL::CStringT< BaseType, StringTraits >::Format ( UINT  nFormatID,
  ... 
)
inline

◆ Format() [2/2]

template<typename BaseType , class StringTraits >
void __cdecl ATL::CStringT< BaseType, StringTraits >::Format ( PCXSTR  pszFormat,
  ... 
)
inline

Definition at line 726 of file cstringt.h.

727  {
728  va_list args;
729  va_start(args, pszFormat);
730  FormatV(pszFormat, args);
731  va_end(args);
732  }
void FormatV(PCXSTR pszFormat, va_list args)
Definition: cstringt.h:734
Definition: match.c:390
#define va_end(ap)
Definition: acmsvcex.h:90
char * va_list
Definition: acmsvcex.h:78
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define args
Definition: format.c:66

◆ FormatMessage() [1/2]

template<typename BaseType , class StringTraits >
void __cdecl ATL::CStringT< BaseType, StringTraits >::FormatMessage ( UINT  nFormatID,
  ... 
)
inline

Definition at line 743 of file cstringt.h.

744  {
745  va_list va;
746  va_start(va, nFormatID);
747 
748  CStringT str;
749  if (str.LoadString(nFormatID))
750  FormatMessageV(str, &va);
751 
752  va_end(va);
753  }
#define va_end(ap)
Definition: acmsvcex.h:90
const WCHAR * str
char * va_list
Definition: acmsvcex.h:78
void FormatMessageV(PCXSTR pszFormat, va_list *pArgList)
Definition: cstringt.h:764
#define va_start(ap, A)
Definition: acmsvcex.h:91

◆ FormatMessage() [2/2]

template<typename BaseType , class StringTraits >
void __cdecl ATL::CStringT< BaseType, StringTraits >::FormatMessage ( PCXSTR  pszFormat,
  ... 
)
inline

Definition at line 755 of file cstringt.h.

756  {
757  va_list va;
758  va_start(va, pszFormat);
759  FormatMessageV(pszFormat, &va);
760  va_end(va);
761  }
#define va_end(ap)
Definition: acmsvcex.h:90
char * va_list
Definition: acmsvcex.h:78
void FormatMessageV(PCXSTR pszFormat, va_list *pArgList)
Definition: cstringt.h:764
#define va_start(ap, A)
Definition: acmsvcex.h:91

◆ FormatMessageV()

template<typename BaseType , class StringTraits >
void ATL::CStringT< BaseType, StringTraits >::FormatMessageV ( PCXSTR  pszFormat,
va_list pArgList 
)
inline

Definition at line 764 of file cstringt.h.

765  {
766  PXSTR psz = StringTraits::FormatMessageV(pszFormat, pArgList);
767  if (!psz)
769 
770  *this = psz;
771  ::LocalFree(psz);
772  }
CThisSimpleString::PXSTR PXSTR
Definition: cstringt.h:376
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577

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

◆ FormatV()

template<typename BaseType , class StringTraits >
void ATL::CStringT< BaseType, StringTraits >::FormatV ( PCXSTR  pszFormat,
va_list  args 
)
inline

Definition at line 734 of file cstringt.h.

735  {
736  int nLength = StringTraits::FormatV(NULL, pszFormat, args);
737 
739  StringTraits::FormatV(pszBuffer, pszFormat, args);
741  }
_In_ DWORD nLength
Definition: wincon.h:476
Definition: match.c:390
smooth NULL
Definition: ftsmooth.c:416
CThisSimpleString::PXSTR PXSTR
Definition: cstringt.h:376

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

◆ GetEnvironmentVariable()

template<typename BaseType , class StringTraits >
BOOL ATL::CStringT< BaseType, StringTraits >::GetEnvironmentVariable ( _In_z_ PCXSTR  pszVar)
inline

◆ Left()

template<typename BaseType , class StringTraits >
CStringT ATL::CStringT< BaseType, StringTraits >::Left ( int  nCount) const
inline

Definition at line 691 of file cstringt.h.

Referenced by CACLCustomMRU::AddMRUString(), and CLayerUIPropPage::InitFile().

◆ LoadFromPtr_()

template<typename BaseType , class StringTraits >
template<typename T_CHAR >
void ATL::CStringT< BaseType, StringTraits >::LoadFromPtr_ ( _In_opt_z_ const T_CHAR pszSrc)
inlineprotected

Definition at line 418 of file cstringt.h.

419  {
420  if (pszSrc == NULL)
421  return;
422  if (IS_INTRESOURCE(pszSrc))
423  LoadString(LOWORD(pszSrc));
424  else
425  *this = pszSrc;
426  }
smooth NULL
Definition: ftsmooth.c:416
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
BOOL LoadString(_In_ UINT nID)
Definition: cstringt.h:554
#define LOWORD(l)
Definition: pedump.c:82

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

◆ LoadString() [1/2]

template<typename BaseType , class StringTraits >
BOOL ATL::CStringT< BaseType, StringTraits >::LoadString ( _In_ UINT  nID)
inline

◆ LoadString() [2/2]

template<typename BaseType , class StringTraits >
_Check_return_ BOOL ATL::CStringT< BaseType, StringTraits >::LoadString ( _In_ HINSTANCE  hInstance,
_In_ UINT  nID 
)
inline

Definition at line 559 of file cstringt.h.

561  {
562  const ATLSTRINGRESOURCEIMAGE* pImage = AtlGetStringResourceImage(hInstance, nID);
563  if (pImage == NULL) return FALSE;
564 
565  int nLength = StringTraits::GetBaseTypeLength(pImage->achString, pImage->nLength);
567  StringTraits::ConvertToBaseType(pszBuffer, nLength, pImage->achString, pImage->nLength);
569 
570  return TRUE;
571  }
#define TRUE
Definition: types.h:120
_In_ DWORD nLength
Definition: wincon.h:476
const ATLSTRINGRESOURCEIMAGE * AtlGetStringResourceImage(_In_ HINSTANCE hInstance, _In_ UINT id)
Definition: atlcore.h:273
HINSTANCE hInstance
Definition: charmap.c:20
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
CThisSimpleString::PXSTR PXSTR
Definition: cstringt.h:376

◆ MakeLower()

template<typename BaseType , class StringTraits >
CStringT& ATL::CStringT< BaseType, StringTraits >::MakeLower ( )
inline

◆ MakeUpper()

template<typename BaseType , class StringTraits >
CStringT& ATL::CStringT< BaseType, StringTraits >::MakeUpper ( )
inline

◆ Mid() [1/2]

template<typename BaseType , class StringTraits >
CStringT ATL::CStringT< BaseType, StringTraits >::Mid ( int  iFirst,
int  nCount 
) const
inline

Definition at line 663 of file cstringt.h.

664  {
666 
667  if (iFirst < 0)
668  iFirst = 0;
669  if (nCount < 0)
670  nCount = 0;
671  if (iFirst > nLength)
672  iFirst = nLength;
673  if (iFirst + nCount > nLength)
674  nCount = nLength - iFirst;
675 
676  return CStringT(CThisSimpleString::GetString() + iFirst, nCount);
677  }
_In_ DWORD nLength
Definition: wincon.h:476

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

◆ Mid() [2/2]

template<typename BaseType , class StringTraits >
CStringT ATL::CStringT< BaseType, StringTraits >::Mid ( int  iFirst) const
inline

Definition at line 679 of file cstringt.h.

680  {
682 
683  if (iFirst < 0)
684  iFirst = 0;
685  if (iFirst > nLength)
686  iFirst = nLength;
687 
688  return CStringT(CThisSimpleString::GetString() + iFirst, nLength - iFirst);
689  }
_In_ DWORD nLength
Definition: wincon.h:476

◆ operator+=() [1/3]

template<typename BaseType , class StringTraits >
CStringT& ATL::CStringT< BaseType, StringTraits >::operator+= ( _In_ const CThisSimpleString str)
inline

Definition at line 536 of file cstringt.h.

537  {
539  return *this;
540  }
const WCHAR * str

◆ operator+=() [2/3]

template<typename BaseType , class StringTraits >
CStringT& ATL::CStringT< BaseType, StringTraits >::operator+= ( _In_z_ PCXSTR  pszSrc)
inline

Definition at line 542 of file cstringt.h.

543  {
545  return *this;
546  }

◆ operator+=() [3/3]

template<typename BaseType , class StringTraits >
CStringT& ATL::CStringT< BaseType, StringTraits >::operator+= ( _In_ XCHAR  ch)
inline

Definition at line 548 of file cstringt.h.

549  {
551  return *this;
552  }

◆ operator=() [1/4]

template<typename BaseType , class StringTraits >
CStringT& ATL::CStringT< BaseType, StringTraits >::operator= ( _In_ const CStringT< BaseType, StringTraits > &  strSrc)
inline

Definition at line 465 of file cstringt.h.

466  {
468  return *this;
469  }

◆ operator=() [2/4]

template<typename BaseType , class StringTraits >
CStringT& ATL::CStringT< BaseType, StringTraits >::operator= ( _In_opt_z_ PCXSTR  pszSrc)
inline

Definition at line 471 of file cstringt.h.

472  {
474  return *this;
475  }

◆ operator=() [3/4]

template<typename BaseType , class StringTraits >
CStringT& ATL::CStringT< BaseType, StringTraits >::operator= ( _In_opt_z_ PCYSTR  pszSrc)
inline

Definition at line 477 of file cstringt.h.

478  {
479  int length = pszSrc ? StringTraits::GetBaseTypeLength(pszSrc) : 0;
480  if (length > 0)
481  {
483  StringTraits::ConvertToBaseType(result, length, pszSrc);
485  }
486  else
487  {
489  }
490  return *this;
491  }
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
CThisSimpleString::PXSTR PXSTR
Definition: cstringt.h:376
GLuint64EXT * result
Definition: glext.h:11304

◆ operator=() [4/4]

template<typename BaseType , class StringTraits >
CStringT& ATL::CStringT< BaseType, StringTraits >::operator= ( _In_ const CThisSimpleString strSrc)
inline

Definition at line 493 of file cstringt.h.

494  {
496  return *this;
497  }

◆ Replace() [1/2]

template<typename BaseType , class StringTraits >
int ATL::CStringT< BaseType, StringTraits >::Replace ( PCXSTR  pszOld,
PCXSTR  pszNew 
)
inline

Definition at line 774 of file cstringt.h.

775  {
777 
779  const int nOldLen = StringTraits::GetBaseTypeLength(pszOld);
780  const int nNewLen = StringTraits::GetBaseTypeLength(pszNew);
781  const int nDiff = nNewLen - nOldLen;
782  int nResultLength = nLength;
783 
784  PCXSTR pszFound;
785  while ((pszFound = StringTraits::FindString(pszString, pszOld)))
786  {
787  nResultLength += nDiff;
788  pszString = pszFound + nOldLen;
789  }
790 
792  return 0;
793 
794  PXSTR pszResult = CThisSimpleString::GetBuffer(nResultLength);
795  PXSTR pszNext;
796  int nCount = 0, nRemaining = nLength;
797  while (nRemaining && (pszNext = StringTraits::FindString(pszResult, pszOld)))
798  {
799  nRemaining -= (pszNext - pszResult);
800  nRemaining -= nOldLen;
801  if (nRemaining > 0)
802  CThisSimpleString::CopyCharsOverlapped(pszNext + nNewLen, nRemaining + 1, pszNext + nOldLen, nRemaining + 1);
803  CThisSimpleString::CopyCharsOverlapped(pszNext, nNewLen, pszNew, nNewLen);
804  pszResult = pszNext + nNewLen;
805  nCount++;
806  }
807 
809 
810  return nCount;
811  }
_In_ DWORD nLength
Definition: wincon.h:476
CThisSimpleString::PCXSTR PCXSTR
Definition: cstringt.h:377
CThisSimpleString::PXSTR PXSTR
Definition: cstringt.h:376
static int FindString(IN FILE *pStream, IN PCWSTR pszFilePath OPTIONAL, IN PCWSTR pszSearchString)
Definition: find.c:106
static void __cdecl CopyCharsOverlapped(_Out_writes_to_(nDestLen, nDestLen) XCHAR *pchDest, _In_ size_t nDestLen, _In_reads_(nChars) const XCHAR *pchSrc, _In_ int nChars)
Definition: atlsimpstr.h:432
_In_ DWORD _In_ DWORD _Out_writes_to_opt_ pcchString LPSTR pszString
Definition: wincrypt.h:4505

Referenced by CACLCustomMRU::AddMRUString(), CCopyToMenu::DoRealCopy(), CMoveToMenu::DoRealMove(), CDownloadManager::DownloadDlgProc(), and CZipExtract::Extract().

◆ Replace() [2/2]

template<typename BaseType , class StringTraits >
int ATL::CStringT< BaseType, StringTraits >::Replace ( XCHAR  chOld,
XCHAR  chNew 
)
inline

Definition at line 813 of file cstringt.h.

814  {
816  PXSTR pszFirst = StringTraits::FindChar(pszString, chOld);
817  if (!pszFirst)
818  return 0;
819 
821  int nCount = 0;
822 
824  pszFirst = pszBuffer + (pszFirst - pszString);
825  do {
826  *pszFirst = chNew;
827  ++nCount;
828  } while ((pszFirst = StringTraits::FindChar(pszFirst + 1, chOld)));
829 
831  return nCount;
832  }
_In_ DWORD nLength
Definition: wincon.h:476
CThisSimpleString::PCXSTR PCXSTR
Definition: cstringt.h:377
CThisSimpleString::PXSTR PXSTR
Definition: cstringt.h:376
_In_ DWORD _In_ DWORD _Out_writes_to_opt_ pcchString LPSTR pszString
Definition: wincrypt.h:4505

◆ ReverseFind()

template<typename BaseType , class StringTraits >
int ATL::CStringT< BaseType, StringTraits >::ReverseFind ( _In_ XCHAR  ch) const
throw (
)
inline

Definition at line 645 of file cstringt.h.

646  {
648  PCXSTR pszResult = StringTraits::FindCharReverse(pszString, ch);
649 
650  return pszResult ? ((int)(pszResult - pszString)) : -1;
651  }
CThisSimpleString::PCXSTR PCXSTR
Definition: cstringt.h:377
_In_ DWORD _In_ DWORD _Out_writes_to_opt_ pcchString LPSTR pszString
Definition: wincrypt.h:4505
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

◆ Right()

template<typename BaseType , class StringTraits >
CStringT ATL::CStringT< BaseType, StringTraits >::Right ( int  nCount) const
inline

Definition at line 703 of file cstringt.h.

704  {
706 
707  if (nCount < 0)
708  nCount = 0;
709  if (nCount > nLength)
710  nCount = nLength;
711 
712  return CStringT(CThisSimpleString::GetString() + nLength - nCount, nCount);
713  }
_In_ DWORD nLength
Definition: wincon.h:476

Referenced by CConfigParser::CacheINILocale().

◆ Tokenize()

template<typename BaseType , class StringTraits >
CStringT ATL::CStringT< BaseType, StringTraits >::Tokenize ( _In_z_ PCXSTR  pszTokens,
_Inout_ int iStart 
) const
inline

Definition at line 835 of file cstringt.h.

836  {
837  ATLASSERT(iStart >= 0);
838 
839  if (iStart < 0)
841 
842  if (!pszTokens || !pszTokens[0])
843  {
845  {
846  return Mid(iStart);
847  }
848  iStart = -1;
849  return CStringT();
850  }
851 
853  {
854  int iRangeOffset = StringTraits::StringSpanIncluding(CThisSimpleString::GetString() + iStart, pszTokens);
855 
856  if (iRangeOffset + iStart < CThisSimpleString::GetLength())
857  {
858  int iNewStart = iStart + iRangeOffset;
859  int nCount = StringTraits::StringSpanExcluding(CThisSimpleString::GetString() + iNewStart, pszTokens);
860 
861  iStart = iNewStart + nCount + 1;
862 
863  return Mid(iNewStart, nCount);
864  }
865  }
866 
867  iStart = -1;
868  return CStringT();
869  }
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
CStringT Mid(int iFirst, int nCount) const
Definition: cstringt.h:663
_In_ UINT iStart
Definition: wingdi.h:3619
#define AtlThrow(x)
Definition: atldef.h:20
#define E_INVALIDARG
Definition: ddrawi.h:101

◆ Trim() [1/3]

template<typename BaseType , class StringTraits >
CStringT& ATL::CStringT< BaseType, StringTraits >::Trim ( )
inline

Definition at line 934 of file cstringt.h.

935  {
936  return Trim(DefaultTrimChars());
937  }
static PCXSTR DefaultTrimChars()
Definition: cstringt.h:871
CStringT & Trim()
Definition: cstringt.h:934

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

◆ Trim() [2/3]

template<typename BaseType , class StringTraits >
CStringT& ATL::CStringT< BaseType, StringTraits >::Trim ( XCHAR  chTarget)
inline

Definition at line 939 of file cstringt.h.

940  {
941  XCHAR str[2] = { chTarget, 0 };
942  return Trim(str);
943  }
const WCHAR * str
CThisSimpleString::XCHAR XCHAR
Definition: cstringt.h:375
CStringT & Trim()
Definition: cstringt.h:934

◆ Trim() [3/3]

template<typename BaseType , class StringTraits >
CStringT& ATL::CStringT< BaseType, StringTraits >::Trim ( PCXSTR  pszTargets)
inline

Definition at line 945 of file cstringt.h.

946  {
947  return TrimRight(pszTargets).TrimLeft(pszTargets);
948  }
CStringT & TrimLeft()
Definition: cstringt.h:878
CStringT & TrimRight()
Definition: cstringt.h:909

◆ TrimLeft() [1/3]

template<typename BaseType , class StringTraits >
CStringT& ATL::CStringT< BaseType, StringTraits >::TrimLeft ( )
inline

Definition at line 878 of file cstringt.h.

879  {
880  return TrimLeft(DefaultTrimChars());
881  }
CStringT & TrimLeft()
Definition: cstringt.h:878
static PCXSTR DefaultTrimChars()
Definition: cstringt.h:871

Referenced by ATL::CStringT< BaseType, StringTraits >::Trim(), and ATL::CStringT< BaseType, StringTraits >::TrimLeft().

◆ TrimLeft() [2/3]

template<typename BaseType , class StringTraits >
CStringT& ATL::CStringT< BaseType, StringTraits >::TrimLeft ( XCHAR  chTarget)
inline

Definition at line 883 of file cstringt.h.

884  {
885  XCHAR str[2] = { chTarget, 0 };
886  return TrimLeft(str);
887  }
CStringT & TrimLeft()
Definition: cstringt.h:878
const WCHAR * str
CThisSimpleString::XCHAR XCHAR
Definition: cstringt.h:375

◆ TrimLeft() [3/3]

template<typename BaseType , class StringTraits >
CStringT& ATL::CStringT< BaseType, StringTraits >::TrimLeft ( PCXSTR  pszTargets)
inline

Definition at line 889 of file cstringt.h.

890  {
893  int nCount = 0;
894 
895  while (nCount < nLength && StringTraits::FindChar(pszTargets, pszBuffer[nCount]))
896  nCount++;
897 
898  if (nCount > 0)
899  {
900  CThisSimpleString::CopyCharsOverlapped(pszBuffer, nLength - nCount, pszBuffer + nCount, nLength - nCount);
901  nLength -= nCount;
902  }
904 
905  return *this;
906  }
_In_ DWORD nLength
Definition: wincon.h:476
CThisSimpleString::PXSTR PXSTR
Definition: cstringt.h:376
static void __cdecl CopyCharsOverlapped(_Out_writes_to_(nDestLen, nDestLen) XCHAR *pchDest, _In_ size_t nDestLen, _In_reads_(nChars) const XCHAR *pchSrc, _In_ int nChars)
Definition: atlsimpstr.h:432

◆ TrimRight() [1/3]

template<typename BaseType , class StringTraits >
CStringT& ATL::CStringT< BaseType, StringTraits >::TrimRight ( )
inline

Definition at line 909 of file cstringt.h.

910  {
911  return TrimRight(DefaultTrimChars());
912  }
CStringT & TrimRight()
Definition: cstringt.h:909
static PCXSTR DefaultTrimChars()
Definition: cstringt.h:871

Referenced by ATL::CStringT< BaseType, StringTraits >::Trim(), and ATL::CStringT< BaseType, StringTraits >::TrimRight().

◆ TrimRight() [2/3]

template<typename BaseType , class StringTraits >
CStringT& ATL::CStringT< BaseType, StringTraits >::TrimRight ( XCHAR  chTarget)
inline

Definition at line 914 of file cstringt.h.

915  {
916  XCHAR str[2] = { chTarget, 0 };
917  return TrimRight(str);
918  }
const WCHAR * str
CThisSimpleString::XCHAR XCHAR
Definition: cstringt.h:375
CStringT & TrimRight()
Definition: cstringt.h:909

◆ TrimRight() [3/3]

template<typename BaseType , class StringTraits >
CStringT& ATL::CStringT< BaseType, StringTraits >::TrimRight ( PCXSTR  pszTargets)
inline

Friends And Related Function Documentation

◆ operator== [1/7]

template<typename BaseType , class StringTraits >
bool operator== ( const CStringT< BaseType, StringTraits > &  str1,
const CStringT< BaseType, StringTraits > &  str2 
)
throw (
)
friend

Definition at line 499 of file cstringt.h.

500  {
501  return str1.Compare(str2) == 0;
502  }

◆ operator== [2/7]

template<typename BaseType , class StringTraits >
bool operator== ( const CStringT< BaseType, StringTraits > &  str1,
PCXSTR  psz2 
)
throw (
)
friend

Definition at line 504 of file cstringt.h.

505  {
506  return str1.Compare(psz2) == 0;
507  }

◆ operator== [3/7]

template<typename BaseType , class StringTraits >
bool operator== ( const CStringT< BaseType, StringTraits > &  str1,
PCYSTR  psz2 
)
throw (
)
friend

Definition at line 509 of file cstringt.h.

510  {
511  CStringT tmp(psz2, str1.GetManager());
512  return tmp.Compare(str1) == 0;
513  }

◆ operator== [4/7]

template<typename BaseType , class StringTraits >
bool operator== ( const CStringT< BaseType, StringTraits > &  str1,
XCHAR  ch2 
)
throw (
)
friend

Definition at line 515 of file cstringt.h.

516  {
517  return str1.GetLength() == 1 && str1[0] == ch2;
518  }

◆ operator== [5/7]

template<typename BaseType , class StringTraits >
bool operator== ( PCXSTR  psz1,
const CStringT< BaseType, StringTraits > &  str2 
)
throw (
)
friend

Definition at line 520 of file cstringt.h.

521  {
522  return str2.Compare(psz1) == 0;
523  }

◆ operator== [6/7]

template<typename BaseType , class StringTraits >
bool operator== ( PCYSTR  psz1,
const CStringT< BaseType, StringTraits > &  str2 
)
throw (
)
friend

Definition at line 525 of file cstringt.h.

526  {
527  CStringT tmp(psz1, str2.GetManager());
528  return tmp.Compare(str2) == 0;
529  }

◆ operator== [7/7]

template<typename BaseType , class StringTraits >
bool operator== ( XCHAR  ch1,
const CStringT< BaseType, StringTraits > &  str2 
)
throw (
)
friend

Definition at line 531 of file cstringt.h.

532  {
533  return str2.GetLength() == 1 && str2[0] == ch1;
534  }

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