home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
yacl-012.zip
/
basedemo
/
set
/
strset.cxx
< prev
Wrap
C/C++ Source or Header
|
1994-10-14
|
687b
|
39 lines
#include "base/strgset.h"
#include <iostream.h>
char* strings [] = {
"Hello",
"Hello, world!",
"Help",
"Hear, hear!",
"Helix",
"Helga",
"Happy",
"Heaven",
0
};
void main ()
{
CL_StringSet aSet;
for (short i = 0; strings[i] != 0; i++)
aSet.Add (strings[i]);
CL_StringSet anotherSet = aSet.StringsWithPrefix ("He");
CL_StringSetIterator itr (anotherSet);
for (itr.Reset(); itr.More(); )
cout << "'" << itr.Next() << "'\n";
cout << (anotherSet == aSet ? "equal" : "not equal") << endl;
cout << (aSet.IncludesAll (anotherSet) ? "includes" : "does not include")
<< endl;
}