Compartir a través de


CSimpleStringT::CSimpleStringT

Constructs a CSimpleStringT object.

CSimpleStringT(
   const XCHAR* pchSrc,
   int nLength,
   IAtlStringMgr* pStringMgr
);
CSimpleStringT(
   PCXSTR pszSrc,
   IAtlStringMgr* pStringMgr
);
CSimpleStringT(
   const CSimpleStringT& strSrc 
);
explicit CSimpleStringT(
   IAtlStringMgr* pStringMgr
) throw( );

Parameters

  • strSrc
    An existing CSimpleStringT object to be copied into this CSimpleStringT object.

  • pchSrc
    A pointer to an array of characters of length nLength, not null terminated.

  • pszSrc
    A null-terminated string to be copied into this CSimpleStringT object.

  • nLength
    A count of the number of characters in pch.

  • pStringMgr
    A pointer to the memory manager of the CSimpleStringT object. For more information on IAtlStringMgr and memory management for CSimpleStringT, see Memory Management and CStringT.

Remarks

Call this method to construct a new CSimpleStringT object with the specified data. Because the constructors copy the input data into new allocated storage, you should be aware that memory exceptions may result.

Example

The following example demonstrates the use of CSimpleStringT::CSimpleStringT.

CSimpleString s1(pMgr);                   // Empty string
CSimpleString s2(_T("cat"), pMgr);        // From a C string literal

CSimpleString s3(s2);                     // Copy constructor
CSimpleString s4(s2 + _T(" ") + s3);      // From a string expression

CSimpleString s5(_T("xxxxxx"), 6, pMgr);  // s5 = "xxxxxx"   

Requirements

Header: atlsimpstr.h

See Also

Concepts

CSimpleStringT Class

CSimpleStringT Members