User Guide

766 Chapter 4: ColdFusion C++ CFX Reference
CCFXStringSet class
Abstract class that represents a set of ordered strings. Strings can be added to a set and can be
retrieved by a numeric index (index values for strings are 1-based). To create a string set, use
CCFXRequest::CreateStringSet.
Class members
CCFXStringSet::AddString
Syntax
int CCFXStringSet::AddString(LPCSTR lpszString)
Description
Adds a string to the end of the list.
Returns
The index of the string that was added.
Parameters
Example
The following example demonstrates adding three strings to a string set and saving the indexes of
the items that are added:
CCFXStringSet* pSet = pRequest->CreateStringSet() ;
int iRed = pSet->AddString( "Red" ) ;
int iGreen = pSet->AddString( "Green" ) ;
int iBlue = pSet->AddString( "Blue" ) ;
CCFXStringSet::GetCount
Syntax
int CCFXStringSet::GetCount(void)
Description
Gets the number of strings in a string set. The value can be used with
CCFXStringSet::GetString to iterate over the strings in the set (recall that the index values for
strings in the list begin at 1).
virtual int AddString( LPCSTR lpszString )
CCFXStringSet::AddString adds a string to
the end of a list.
virtual int GetCount()
CCFXStringSet::GetCount gets the number
of strings contained in a list.
virtual LPCSTR GetString( int iIndex )
CCFXStringSet::GetString gets the string
located at the passed index.
virtual int GetIndexForString
( LPCSTR lpszString )
CCFXStringSet::GetIndexForString gets
the index for the passed string.
Parameter Description
lpszString String to add to the list