home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / yacl-012.zip / basedemo / set / strset.cxx < prev   
C/C++ Source or Header  |  1994-10-14  |  687b  |  39 lines

  1.  
  2.  
  3.  
  4. #include "base/strgset.h"
  5. #include <iostream.h>
  6.  
  7.  
  8. char* strings [] = {
  9.     "Hello",
  10.     "Hello, world!",
  11.     "Help",
  12.     "Hear, hear!",
  13.     "Helix",
  14.     "Helga",
  15.     "Happy",
  16.     "Heaven",
  17.     0
  18. };
  19.  
  20.     
  21.  
  22.  
  23.  
  24. void main ()
  25. {
  26.     CL_StringSet aSet;
  27.  
  28.     for (short i = 0; strings[i] != 0; i++)
  29.         aSet.Add (strings[i]);
  30.     CL_StringSet anotherSet = aSet.StringsWithPrefix ("He");
  31.     CL_StringSetIterator itr (anotherSet);
  32.     for (itr.Reset(); itr.More(); ) 
  33.         cout << "'" << itr.Next() << "'\n";
  34.     cout << (anotherSet == aSet ? "equal" : "not equal") << endl;
  35.     cout << (aSet.IncludesAll (anotherSet) ? "includes" : "does not include")
  36.          << endl;
  37.              
  38. }
  39.