ReactOS 0.4.15-dev-8413-gc1c91f2
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 () noexcept
 
 CStringT (_In_ IAtlStringMgr *pStringMgr) noexcept
 
 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 noexcept
 
int Find (_In_ XCHAR ch, _In_opt_ int iStart=0) const noexcept
 
int FindOneOf (_In_ PCXSTR pszCharSet) const noexcept
 
int ReverseFind (_In_ XCHAR ch) const noexcept
 
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 AppendFormat (UINT nFormatID,...)
 
void __cdecl AppendFormat (PCXSTR pszFormat,...)
 
void __cdecl Format (UINT nFormatID,...)
 
void __cdecl Format (PCXSTR pszFormat,...)
 
void AppendFormatV (PCXSTR pszFormat, va_list args)
 
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 () noexcept
 
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 noexcept
 
void Empty () noexcept
 
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 noexcept
 
int GetLength () const noexcept
 
PXSTR GetString () noexcept
 
PCXSTR GetString () const noexcept
 
void Preallocate (_In_ int nLength)
 
void ReleaseBufferSetLength (_In_ int nNewLength)
 
void ReleaseBuffer (_In_ int nNewLength=-1)
 
bool IsEmpty () const noexcept
 
CStringDataGetData () const noexcept
 
IAtlStringMgrGetManager () const noexcept
 

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) noexcept
 
static void __cdecl CopyCharsOverlapped (_Out_writes_to_(nDestLen, nDestLen) XCHAR *pchDest, _In_ size_t nDestLen, _In_reads_(nChars) const XCHAR *pchSrc, _In_ int nChars) noexcept
 
static int __cdecl StringLength (_In_opt_z_ const char *psz) noexcept
 
static int __cdecl StringLength (_In_opt_z_ const wchar_t *psz) noexcept
 

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) noexcept
 
bool operator== (const CStringT &str1, PCXSTR psz2) noexcept
 
bool operator== (const CStringT &str1, PCYSTR psz2) noexcept
 
bool operator== (const CStringT &str1, XCHAR ch2) noexcept
 
bool operator== (PCXSTR psz1, const CStringT &str2) noexcept
 
bool operator== (PCYSTR psz1, const CStringT &str2) noexcept
 
bool operator== (XCHAR ch1, const CStringT &str2) noexcept
 
bool operator!= (const CStringT &str1, const CStringT &str2) noexcept
 
bool operator!= (const CStringT &str1, PCXSTR psz2) noexcept
 
bool operator!= (const CStringT &str1, PCYSTR psz2) noexcept
 
bool operator!= (const CStringT &str1, XCHAR ch2) noexcept
 
bool operator!= (PCXSTR psz1, const CStringT &str2) noexcept
 
bool operator!= (PCYSTR psz1, const CStringT &str2) noexcept
 
bool operator!= (XCHAR ch1, const CStringT &str2) noexcept
 

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 417 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 421 of file cstringt.h.

◆ PCXSTR

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

Definition at line 425 of file cstringt.h.

◆ PCYSTR

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

Definition at line 428 of file cstringt.h.

◆ PXSTR

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

Definition at line 424 of file cstringt.h.

◆ PYSTR

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

Definition at line 427 of file cstringt.h.

◆ StrTraits

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

Definition at line 422 of file cstringt.h.

◆ XCHAR

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

Definition at line 423 of file cstringt.h.

◆ YCHAR

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

Definition at line 426 of file cstringt.h.

Constructor & Destructor Documentation

◆ CStringT() [1/11]

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

Definition at line 431 of file cstringt.h.

431 :
432 CThisSimpleString(StringTraits::GetDefaultManager())
433 {
434 }
CSimpleStringT< BaseType, _CSTRING_IMPL_::_MFCDLLTraitsCheck< BaseType, StringTraits >::c_bIsMFCDLLTraits > CThisSimpleString
Definition: cstringt.h:421

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)
inlineexplicitnoexcept

Definition at line 436 of file cstringt.h.

436 :
437 CThisSimpleString(pStringMgr)
438 {
439 }

◆ CStringT() [3/11]

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

Definition at line 446 of file cstringt.h.

446 :
447 CThisSimpleString(strSrc)
448 {
449 }

◆ CStringT() [4/11]

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

Definition at line 451 of file cstringt.h.

451 :
452 CThisSimpleString(strSrc)
453 {
454 }

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

457 :
458 CThisSimpleString(StringTraits::GetDefaultManager())
459 {
460 *this = static_cast<const YCHAR*>(strSrc);
461 }
CThisSimpleString::YCHAR YCHAR
Definition: cstringt.h:426

◆ CStringT() [6/11]

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

Definition at line 477 of file cstringt.h.

477 :
478 CThisSimpleString(StringTraits::GetDefaultManager())
479 {
480 LoadFromPtr_(pszSrc);
481 }
void LoadFromPtr_(_In_opt_z_ const T_CHAR *pszSrc)
Definition: cstringt.h:466

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

484 : CThisSimpleString(pStringMgr)
485 {
486 LoadFromPtr_(pszSrc);
487 }

◆ CStringT() [8/11]

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

Definition at line 489 of file cstringt.h.

489 :
490 CThisSimpleString(StringTraits::GetDefaultManager())
491 {
492 LoadFromPtr_(pszSrc);
493 }

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

496 : CThisSimpleString(pStringMgr)
497 {
498 LoadFromPtr_(pszSrc);
499 }

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

502 :
503 CThisSimpleString(pch, nLength, StringTraits::GetDefaultManager())
504 {
505 }
#define pch(ap)
Definition: match.c:418
_In_ DWORD nLength
Definition: wincon.h:473

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

508 :
509 CThisSimpleString(pch, nLength, StringTraits::GetDefaultManager())
510 {
511 }

Member Function Documentation

◆ AllocSysString()

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

◆ AppendFormat() [1/2]

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

Definition at line 810 of file cstringt.h.

811 {
813 va_start(args, pszFormat);
814 AppendFormatV(pszFormat, args);
815 va_end(args);
816 }
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
void AppendFormatV(PCXSTR pszFormat, va_list args)
Definition: cstringt.h:836
#define args
Definition: format.c:66
Definition: match.c:390

◆ AppendFormat() [2/2]

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

Definition at line 800 of file cstringt.h.

801 {
803 va_start(args, nFormatID);
804 CStringT formatString;
805 if (formatString.LoadString(nFormatID))
806 AppendFormatV(formatString, args);
807 va_end(args);
808 }
CStringT() noexcept
Definition: cstringt.h:431

Referenced by to_str().

◆ AppendFormatV()

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

Definition at line 836 of file cstringt.h.

837 {
838 int nLength = StringTraits::FormatV(NULL, pszFormat, args);
840
842 StringTraits::FormatV(pszBuffer + nCurrent, pszFormat, args);
844 }
CThisSimpleString::PXSTR PXSTR
Definition: cstringt.h:424
#define NULL
Definition: types.h:112
INT nCurrent
Definition: api.c:63

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

◆ Compare()

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

Definition at line 738 of file cstringt.h.

739 {
740 return StringTraits::Compare(CThisSimpleString::GetString(), psz);
741 }

Referenced by CAppsListView::CompareFunc(), and ExtractAndInstallThread().

◆ CompareNoCase()

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

◆ Construct()

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

Definition at line 441 of file cstringt.h.

442 {
443 new(pString) CStringT;
444 }
FxString * pString

◆ DefaultTrimChars()

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

Definition at line 983 of file cstringt.h.

984 {
985 static XCHAR str[] = { ' ', '\t', '\r', '\n', 0 };
986 return str;
987 }
CThisSimpleString::XCHAR XCHAR
Definition: cstringt.h:423
const WCHAR * str

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
inlinenoexcept

Definition at line 696 of file cstringt.h.

697 {
699
700 if (iStart >= nLength || iStart < 0)
701 return -1;
702
704 PCXSTR pszResult = StringTraits::FindString(pszString + iStart, pszSub);
705
706 return pszResult ? ((int)(pszResult - pszString)) : -1;
707 }
CThisSimpleString::PCXSTR PCXSTR
Definition: cstringt.h:425
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
_In_ DWORD _In_ DWORD _Out_writes_to_opt_ pcchString LPSTR pszString
Definition: wincrypt.h:4505
_In_ UINT iStart
Definition: wingdi.h:3620

Referenced by AddUninstallOperationsFromDB(), ExtractAndInstallThread(), ATL::CImage::FindCodecForExtension(), CImageDx::FindCodecForExtension(), FNFDINOTIFY(), CACLCustomMRU::LoadMRUList(), and CConfigParser::ReadSection().

◆ Find() [2/2]

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

Definition at line 709 of file cstringt.h.

710 {
712
713 if (iStart >= nLength || iStart < 0)
714 return -1;
715
717 PCXSTR pszResult = StringTraits::FindChar(pszString + iStart, ch);
718
719 return pszResult ? ((int)(pszResult - pszString)) : -1;
720 }

◆ FindOneOf()

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

Definition at line 722 of file cstringt.h.

723 {
725 PCXSTR pszResult = StringTraits::FindOneOf(pszString, pszCharSet);
726
727 return pszResult ? ((int)(pszResult - pszString)) : -1;
728 }

◆ Format() [1/2]

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

Definition at line 828 of file cstringt.h.

829 {
831 va_start(args, pszFormat);
832 FormatV(pszFormat, args);
833 va_end(args);
834 }
void FormatV(PCXSTR pszFormat, va_list args)
Definition: cstringt.h:846

◆ Format() [2/2]

◆ FormatMessage() [1/2]

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

Definition at line 867 of file cstringt.h.

868 {
869 va_list va;
870 va_start(va, pszFormat);
871 FormatMessageV(pszFormat, &va);
872 va_end(va);
873 }
void FormatMessageV(PCXSTR pszFormat, va_list *pArgList)
Definition: cstringt.h:876

◆ FormatMessage() [2/2]

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

Definition at line 855 of file cstringt.h.

856 {
857 va_list va;
858 va_start(va, nFormatID);
859
861 if (str.LoadString(nFormatID))
862 FormatMessageV(str, &va);
863
864 va_end(va);
865 }

Referenced by CZipExtract::ShowExtractError().

◆ FormatMessageV()

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

Definition at line 876 of file cstringt.h.

877 {
878 PXSTR psz = StringTraits::FormatMessageV(pszFormat, pArgList);
879 if (!psz)
881
882 *this = psz;
883 ::LocalFree(psz);
884 }
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594

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

847 {
848 int nLength = StringTraits::FormatV(NULL, pszFormat, args);
849
851 StringTraits::FormatV(pszBuffer, pszFormat, args);
853 }

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

◆ GetEnvironmentVariable()

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

Definition at line 658 of file cstringt.h.

659 {
660 int nLength = StringTraits::GetEnvironmentVariable(pszVar, NULL, 0);
661
662 if (nLength > 0)
663 {
665 StringTraits::GetEnvironmentVariable(pszVar, pszBuffer, nLength);
667 return TRUE;
668 }
669
671 return FALSE;
672 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117

Referenced by CLayerUIPropPage::InitFile(), and CTrayWindow::RunFileDlgThread().

◆ Left()

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

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

467 {
468 if (pszSrc == NULL)
469 return;
470 if (IS_INTRESOURCE(pszSrc))
471 LoadString(LOWORD(pszSrc));
472 else
473 *this = pszSrc;
474 }
#define LOWORD(l)
Definition: pedump.c:82
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
#define LoadString
Definition: winuser.h:5828

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

◆ LoadString() [1/2]

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

Definition at line 644 of file cstringt.h.

646 {
647 const ATLSTRINGRESOURCEIMAGE* pImage = AtlGetStringResourceImage(hInstance, nID);
648 if (pImage == NULL) return FALSE;
649
650 int nLength = StringTraits::GetBaseTypeLength(pImage->achString, pImage->nLength);
652 StringTraits::ConvertToBaseType(pszBuffer, nLength, pImage->achString, pImage->nLength);
654
655 return TRUE;
656 }
HINSTANCE hInstance
Definition: charmap.c:19
const ATLSTRINGRESOURCEIMAGE * AtlGetStringResourceImage(_In_ HINSTANCE hInstance, _In_ UINT id) noexcept
Definition: atlcore.h:273

◆ LoadString() [2/2]

◆ MakeLower()

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

Definition at line 674 of file cstringt.h.

675 {
678
679 StringTraits::MakeLower(pszBuffer, nLength);
681
682 return *this;
683 }

Referenced by CLayerUIPropPage::InitFile().

◆ MakeUpper()

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

Definition at line 685 of file cstringt.h.

686 {
689
690 StringTraits::MakeUpper(pszBuffer, nLength);
692
693 return *this;
694 }

Referenced by DoGetNameInZip().

◆ Mid() [1/2]

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

Definition at line 764 of file cstringt.h.

765 {
767
768 if (iFirst < 0)
769 iFirst = 0;
770 if (iFirst > nLength)
771 iFirst = nLength;
772
773 return CStringT(CThisSimpleString::GetString() + iFirst, nLength - iFirst);
774 }

◆ Mid() [2/2]

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

Definition at line 748 of file cstringt.h.

749 {
751
752 if (iFirst < 0)
753 iFirst = 0;
754 if (nCount < 0)
755 nCount = 0;
756 if (iFirst > nLength)
757 iFirst = nLength;
758 if (iFirst + nCount > nLength)
759 nCount = nLength - iFirst;
760
761 return CStringT(CThisSimpleString::GetString() + iFirst, nCount);
762 }

Referenced by AddUninstallOperationsFromDB(), ExtractAndInstallThread(), ExtractFilesFromZip(), ATL::CImage::FindCodecForExtension(), CImageDx::FindCodecForExtension(), InstallFiles(), CAutoComplete::LoadQuickComplete(), CConfigParser::ReadSection(), CInstalledApplicationInfo::RetrieveInstallDate(), and ATL::CStringT< BaseType, StringTraits >::Tokenize().

◆ operator+=() [1/3]

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

Definition at line 621 of file cstringt.h.

◆ operator+=() [2/3]

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

Definition at line 633 of file cstringt.h.

634 {
636 return *this;
637 }

◆ operator+=() [3/3]

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

Definition at line 627 of file cstringt.h.

628 {
630 return *this;
631 }

◆ operator=() [1/4]

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

Definition at line 513 of file cstringt.h.

◆ operator=() [2/4]

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

Definition at line 541 of file cstringt.h.

542 {
544 return *this;
545 }

◆ operator=() [3/4]

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

Definition at line 519 of file cstringt.h.

520 {
522 return *this;
523 }

◆ operator=() [4/4]

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

Definition at line 525 of file cstringt.h.

526 {
527 int length = pszSrc ? StringTraits::GetBaseTypeLength(pszSrc) : 0;
528 if (length > 0)
529 {
531 StringTraits::ConvertToBaseType(result, length, pszSrc);
533 }
534 else
535 {
537 }
538 return *this;
539 }
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLuint64EXT * result
Definition: glext.h:11304

◆ Replace() [1/2]

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

Definition at line 886 of file cstringt.h.

887 {
889
891 const int nOldLen = StringTraits::GetBaseTypeLength(pszOld);
892 const int nNewLen = StringTraits::GetBaseTypeLength(pszNew);
893 const int nDiff = nNewLen - nOldLen;
894 int nResultLength = nLength;
895
896 PCXSTR pszFound;
897 while ((pszFound = StringTraits::FindString(pszString, pszOld)))
898 {
899 nResultLength += nDiff;
900 pszString = pszFound + nOldLen;
901 }
902
904 return 0;
905
906 PXSTR pszResult = CThisSimpleString::GetBuffer(nResultLength);
907 PXSTR pszNext;
908 int nCount = 0, nRemaining = nLength;
909 while (nRemaining && (pszNext = StringTraits::FindString(pszResult, pszOld)))
910 {
911 nRemaining -= (pszNext - pszResult);
912 nRemaining -= nOldLen;
913 if (nRemaining > 0)
914 CThisSimpleString::CopyCharsOverlapped(pszNext + nNewLen, nRemaining + 1, pszNext + nOldLen, nRemaining + 1);
915 CThisSimpleString::CopyCharsOverlapped(pszNext, nNewLen, pszNew, nNewLen);
916 pszResult = pszNext + nNewLen;
917 nCount++;
918 }
919
921
922 return nCount;
923 }
static void __cdecl CopyCharsOverlapped(_Out_writes_to_(nDestLen, nDestLen) XCHAR *pchDest, _In_ size_t nDestLen, _In_reads_(nChars) const XCHAR *pchSrc, _In_ int nChars) noexcept
Definition: atlsimpstr.h:447

Referenced by CACLCustomMRU::AddMRUString(), CreateShortcut(), CCopyMoveToMenu::DoRealFileOp(), CDownloadManager::DownloadDlgProc(), ExtractFilesFromZip(), CMainWindow::GetOpenFileName(), and CMainWindow::GetSaveFileName().

◆ Replace() [2/2]

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

Definition at line 925 of file cstringt.h.

926 {
928 PXSTR pszFirst = StringTraits::FindChar(pszString, chOld);
929 if (!pszFirst)
930 return 0;
931
933 int nCount = 0;
934
936 pszFirst = pszBuffer + (pszFirst - pszString);
937 do {
938 *pszFirst = chNew;
939 ++nCount;
940 } while ((pszFirst = StringTraits::FindChar(pszFirst + 1, chOld)));
941
943 return nCount;
944 }

◆ ReverseFind()

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

Definition at line 730 of file cstringt.h.

731 {
733 PCXSTR pszResult = StringTraits::FindCharReverse(pszString, ch);
734
735 return pszResult ? ((int)(pszResult - pszString)) : -1;
736 }

Referenced by ATL::CImage::FindCodecForExtension(), CImageDx::FindCodecForExtension(), CAutoComplete::GetStemText(), and CAutoComplete::LoadQuickComplete().

◆ Right()

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

Definition at line 788 of file cstringt.h.

789 {
791
792 if (nCount < 0)
793 nCount = 0;
794 if (nCount > nLength)
795 nCount = nLength;
796
797 return CStringT(CThisSimpleString::GetString() + nLength - nCount, nCount);
798 }

Referenced by CConfigParser::CacheINI(), and ExtractAndInstallThread().

◆ Tokenize()

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

Definition at line 947 of file cstringt.h.

948 {
949 ATLASSERT(iStart >= 0);
950
951 if (iStart < 0)
953
954 if (!pszTokens || !pszTokens[0])
955 {
957 {
958 return Mid(iStart);
959 }
960 iStart = -1;
961 return CStringT();
962 }
963
965 {
966 int iRangeOffset = StringTraits::StringSpanIncluding(CThisSimpleString::GetString() + iStart, pszTokens);
967
968 if (iRangeOffset + iStart < CThisSimpleString::GetLength())
969 {
970 int iNewStart = iStart + iRangeOffset;
971 int nCount = StringTraits::StringSpanExcluding(CThisSimpleString::GetString() + iNewStart, pszTokens);
972
973 iStart = iNewStart + nCount + 1;
974
975 return Mid(iNewStart, nCount);
976 }
977 }
978
979 iStart = -1;
980 return CStringT();
981 }
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
#define AtlThrow(x)
Definition: atldef.h:20
CStringT Mid(int iFirst, int nCount) const
Definition: cstringt.h:748
#define E_INVALIDARG
Definition: ddrawi.h:101

Referenced by CompareVersion(), FNFDINOTIFY(), and CAvailableApplicationInfo::RetrieveLanguages().

◆ Trim() [1/3]

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

Definition at line 1046 of file cstringt.h.

1047 {
1048 return Trim(DefaultTrimChars());
1049 }
static PCXSTR DefaultTrimChars()
Definition: cstringt.h:983
CStringT & Trim()
Definition: cstringt.h:1046

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

◆ Trim() [2/3]

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

Definition at line 1057 of file cstringt.h.

1058 {
1059 return TrimRight(pszTargets).TrimLeft(pszTargets);
1060 }
CStringT & TrimRight()
Definition: cstringt.h:1021
CStringT & TrimLeft()
Definition: cstringt.h:990

◆ Trim() [3/3]

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

Definition at line 1051 of file cstringt.h.

1052 {
1053 XCHAR str[2] = { chTarget, 0 };
1054 return Trim(str);
1055 }

◆ TrimLeft() [1/3]

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

◆ TrimLeft() [2/3]

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

Definition at line 1001 of file cstringt.h.

1002 {
1005 int nCount = 0;
1006
1007 while (nCount < nLength && StringTraits::FindChar(pszTargets, pszBuffer[nCount]))
1008 nCount++;
1009
1010 if (nCount > 0)
1011 {
1012 CThisSimpleString::CopyCharsOverlapped(pszBuffer, nLength - nCount, pszBuffer + nCount, nLength - nCount);
1013 nLength -= nCount;
1014 }
1016
1017 return *this;
1018 }

◆ TrimLeft() [3/3]

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

Definition at line 995 of file cstringt.h.

996 {
997 XCHAR str[2] = { chTarget, 0 };
998 return TrimLeft(str);
999 }

◆ TrimRight() [1/3]

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

◆ TrimRight() [2/3]

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

Definition at line 1032 of file cstringt.h.

1033 {
1036
1037 while (nLength > 0 && StringTraits::FindChar(pszTargets, pszBuffer[nLength-1]))
1038 nLength--;
1039
1041
1042 return *this;
1043 }

◆ TrimRight() [3/3]

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

Definition at line 1026 of file cstringt.h.

1027 {
1028 XCHAR str[2] = { chTarget, 0 };
1029 return TrimRight(str);
1030 }

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 
)
friend

Definition at line 584 of file cstringt.h.

585 {
586 return str1.Compare(str2) != 0;
587 }

◆ operator!= [2/7]

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

Definition at line 589 of file cstringt.h.

590 {
591 return str1.Compare(psz2) != 0;
592 }

◆ operator!= [3/7]

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

Definition at line 594 of file cstringt.h.

595 {
596 CStringT tmp(psz2, str1.GetManager());
597 return tmp.Compare(str1) != 0;
598 }

◆ operator!= [4/7]

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

Definition at line 600 of file cstringt.h.

601 {
602 return str1.GetLength() != 1 || str1[0] != ch2;
603 }

◆ operator!= [5/7]

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

Definition at line 605 of file cstringt.h.

606 {
607 return str2.Compare(psz1) != 0;
608 }

◆ operator!= [6/7]

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

Definition at line 610 of file cstringt.h.

611 {
612 CStringT tmp(psz1, str2.GetManager());
613 return tmp.Compare(str2) != 0;
614 }

◆ operator!= [7/7]

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

Definition at line 616 of file cstringt.h.

617 {
618 return str2.GetLength() != 1 || str2[0] != ch1;
619 }

◆ operator== [1/7]

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

Definition at line 547 of file cstringt.h.

548 {
549 return str1.Compare(str2) == 0;
550 }

◆ operator== [2/7]

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

Definition at line 552 of file cstringt.h.

553 {
554 return str1.Compare(psz2) == 0;
555 }

◆ operator== [3/7]

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

Definition at line 557 of file cstringt.h.

558 {
559 CStringT tmp(psz2, str1.GetManager());
560 return tmp.Compare(str1) == 0;
561 }

◆ operator== [4/7]

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

Definition at line 563 of file cstringt.h.

564 {
565 return str1.GetLength() == 1 && str1[0] == ch2;
566 }

◆ operator== [5/7]

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

Definition at line 568 of file cstringt.h.

569 {
570 return str2.Compare(psz1) == 0;
571 }

◆ operator== [6/7]

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

Definition at line 573 of file cstringt.h.

574 {
575 CStringT tmp(psz1, str2.GetManager());
576 return tmp.Compare(str2) == 0;
577 }

◆ operator== [7/7]

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

Definition at line 579 of file cstringt.h.

580 {
581 return str2.GetLength() == 1 && str2[0] == ch1;
582 }

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