Udostępnij za pośrednictwem


CStringData Class

This class represents the data of a string object.

struct CStringData

Remarks

This class should only be used by developers implementing custom string managers. For more information on custom string managers, see Memory Management and CStringT

This class encapsulates various types of information and data associated with a higher string object, such as CStringT, CSimpleStringT, or CFixedStringT objects. Every higher string object contains a pointer to its associated CStringData object, allowing multiple string objects to point to the same string data object. This relationship is represented by the reference count (nRefs) of the CStringData object.

Note

In certain cases, a string type (such as CFixedString) will not share a string data object with more than one higher string object. For more information on this, see Memory Management and CStringT.

This data is composed of:

  • The memory manager (of type IAtlStringMgr) of the string.

  • The current length (nDataLength) of the string.

  • The allocated length (nAllocLength) of the string. For performance reasons, this can differ from the current string length

  • The current reference count (nRefs) of the CStringData object. This value is used in determining how many string objects are sharing the same CStringData object.

  • The actual character buffer (data) of the string.

    Note

    The actual character buffer of the string object is allocated by the string manager and is appended to the CStringData object.

Requirements

Header: atlsimpstr.h

See Also

Reference

Hierarchy Chart

Other Resources

CStringData Members

ATL/MFC Shared Classes