Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / programs / nsgmls / StringSet.h
1 /* $XConsortium: StringSet.h /main/1 1996/07/29 17:05:35 cde-hp $ */
2 // Copyright (c) 1994 James Clark
3 // See the file COPYING for copying permission.
4
5 #ifndef StringSet_INCLUDED
6 #define StringSet_INCLUDED 1
7
8 #include "StringC.h"
9 #include "Hash.h"
10 #include "Boolean.h"
11 #include "OwnerTable.h"
12
13 #ifdef SP_NAMESPACE
14 namespace SP_NAMESPACE {
15 #endif
16
17 class StringSetKey {
18 public:
19   static inline const StringC &key(const StringC &str) { return str; }
20 };
21
22 class StringSet {
23 public:
24   StringSet();
25   Boolean add(const StringC &); // return 1 if already there
26   void swap(StringSet &);
27   void clear();
28 private:
29   StringSet(const StringSet &); // undefined
30   void operator=(const StringSet &); // undefined
31   OwnerTable<StringC, StringC, Hash, StringSetKey> table_;
32 };
33
34 inline
35 void StringSet::clear()
36 {
37   table_.clear();
38 }
39
40 #ifdef SP_NAMESPACE
41 }
42 #endif
43
44 #endif /* not StringSet_INCLUDED */