Update TCL libraries link and restrict tcl8.6 only to SuSE.
[oweals/cde.git] / cde / programs / nsgmls / Partition.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these libraries and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: Partition.h /main/1 1996/07/29 17:01:35 cde-hp $ */
24 // Copyright (c) 1994 James Clark
25 // See the file COPYING for copying permission.
26
27 #ifndef Partition_INCLUDED
28 #define Partition_INCLUDED 1
29 #ifdef __GNUG__
30 #pragma interface
31 #endif
32
33 #include "types.h"
34 #include "SubstTable.h"
35 #include "StringOf.h"
36 #include "ISet.h"
37 #include "XcharMap.h"
38 #include "Vector.h"
39
40 #ifdef SP_NAMESPACE
41 namespace SP_NAMESPACE {
42 #endif
43
44 class Partition {
45 public:
46   Partition(const ISet<Char> &chars,
47             const ISet<Char> **sets,
48             int nSets,
49             const SubstTable<Char> &subst);
50   EquivCode maxCode() const;
51   EquivCode charCode(Char c) const;
52   EquivCode eECode() const;
53   const String<EquivCode> &setCodes(int i) const;
54   const XcharMap<EquivCode> &map() const;
55 private:
56   Partition(const Partition &); // undefined
57   void operator=(const Partition &); // undefined
58   EquivCode maxCode_;
59   Vector<String<EquivCode> > setCodes_;
60   XcharMap<EquivCode> map_;
61 };
62
63 inline
64 EquivCode Partition::maxCode() const
65 {
66   return maxCode_;
67 }
68
69 inline
70 EquivCode Partition::charCode(Char c) const
71 {
72   return map_[c];
73 }
74
75 inline
76 EquivCode Partition::eECode() const
77 {
78   return 0;
79 }
80
81 inline
82 const String<EquivCode> &Partition::setCodes(int i) const
83 {
84   return setCodes_[i];
85 }
86
87 inline
88 const XcharMap<EquivCode> &Partition::map() const
89 {
90   return map_;
91 }
92
93 #ifdef SP_NAMESPACE
94 }
95 #endif
96
97 #endif /* not Partition_INCLUDED */