description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Learn more about: CStringElementTraitsI Class |
CStringElementTraitsI Class |
11/04/2016 |
|
|
c23f92b1-91e5-400f-96ed-258b02622b7a |
This class provides static functions related to strings stored in collection class objects. It is similar to CStringElementTraits, but performs case-insensitive comparisons.
template <typename T, class CharTraits = CDefaultCharTraits<T ::XCHAR>>
class CStringElementTraitsI : public CElementTraitsBase<T>
T
The type of data to be stored in the collection.
Name | Description |
---|---|
CStringElementTraitsI::INARGTYPE | The data type to use for adding elements to the collection class object. |
CStringElementTraitsI::OUTARGTYPE | The data type to use for retrieving elements from the collection class object. |
Name | Description |
---|---|
CStringElementTraitsI::CompareElements | Call this static function to compare two string elements for equality, ignoring differences in case. |
CStringElementTraitsI::CompareElementsOrdered | Call this static function to compare two string elements, ignoring differences in case. |
CStringElementTraitsI::Hash | Call this static function to calculate a hash value for the given string element. |
This class provides static functions for comparing strings and for creating a hash value. These functions are useful when using a collection class to store string-based data. Use CStringRefElementTraits when the string objects are to be with dealt with as references.
For more information, see ATL Collection Classes.
CStringElementTraitsI
Header: atlcoll.h
Call this static function to compare two string elements for equality, ignoring differences in case.
static bool CompareElements(INARGTYPE str1, INARGTYPE str2) throw();
str1
The first string element.
str2
The second string element.
Returns true if the elements are equal, false otherwise.
Comparisons are case insensitive.
Call this static function to compare two string elements, ignoring differences in case.
static int CompareElementsOrdered(INARGTYPE str1, INARGTYPE str2) throw();
str1
The first string element.
str2
The second string element.
Zero if the strings are identical, < 0 if str1 is less than str2, or > 0 if str1 is greater than str2. The CStringT::Compare method is used to perform the comparisons.
Comparisons are case insensitive.
Call this static function to calculate a hash value for the given string element.
static ULONG Hash(INARGTYPE str) throw();
str
The string element.
Returns a hash value, calculated using the string's contents.
The data type to use for adding elements to the collection class object.
typedef T::PCXSTR INARGTYPE;
The data type to use for retrieving elements from the collection class object.
typedef T& OUTARGTYPE;
CElementTraitsBase Class
Class Overview
CStringElementTraits Class