다음을 통해 공유


CStringElementTraits Class

This class provides static functions used by collection classes storing CString objects.

template< 
   typename T  
> 
class CStringElementTraits

Parameters

  • T
    The type of data to be stored in the collection.

Members

Public Typedefs

Name

Description

CStringElementTraits::INARGTYPE

The data type to use for adding elements to the collection class object.

CStringElementTraits::OUTARGTYPE

The data type to use for retrieving elements from the collection class object.

Public Methods

Name

Description

CStringElementTraits::CompareElements

(Static) Call this function to compare two string elements for equality.

CStringElementTraits::CompareElementsOrdered

(Static) Call this function to compare two string elements.

CStringElementTraits::CopyElements

(Static) Call this function to copy CString elements stored in a collection class object.

CStringElementTraits::Hash

(Static) Call this function to calculate a hash value for the given string element.

CStringElementTraits::RelocateElements

(Static) Call this function to relocate CString elements stored in a collection class object.

Remarks

This class provides static functions for copying, moving, and comparing strings and for creating a hash value. These functions are useful when using a collection class to store string-based data. Use CStringElementTraitsI when case-insensitive comparisons are required. Use CStringRefElementTraits when the string objects are to be dealt with as references.

For more information, see ATL Collection Classes.

Requirements

Header: cstringt.h

See Also

Reference

CElementTraitsBase Class

CStringElementTraitsI Class

Other Resources

ATL Class Overview