2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
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)
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
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: CharsetDecl.h /main/1 1996/07/29 16:47:13 cde-hp $ */
24 // Copyright (c) 1994 James Clark
25 // See the file COPYING for copying permission.
27 #ifndef CharsetDecl_INCLUDED
28 #define CharsetDecl_INCLUDED 1
35 #include "ExternalId.h"
40 namespace SP_NAMESPACE {
43 class SP_API CharsetDeclRange {
51 CharsetDeclRange(WideChar, Number, WideChar);
52 CharsetDeclRange(WideChar, Number);
53 CharsetDeclRange(WideChar, Number, const StringC &);
54 void rangeDeclared(WideChar min, Number count,
55 ISet<WideChar> &declared) const;
56 void usedSet(ISet<Char> &) const;
57 Boolean getCharInfo(WideChar fromChar,
58 CharsetDeclRange::Type &type,
62 void stringToChar(const StringC &str, ISet<WideChar> &to) const;
63 void numberToChar(Number n, ISet<WideChar> &to, Number &count) const;
72 class SP_API CharsetDeclSection {
75 void setPublicId(const PublicId &);
76 void addRange(const CharsetDeclRange &);
77 void rangeDeclared(WideChar min, Number count,
78 ISet<WideChar> &declared) const;
79 void usedSet(ISet<Char> &) const;
80 Boolean getCharInfo(WideChar fromChar,
82 CharsetDeclRange::Type &type,
86 void stringToChar(const StringC &str, ISet<WideChar> &to) const;
87 void numberToChar(const PublicId *id, Number n,
88 ISet<WideChar> &to, Number &count) const;
91 Vector<CharsetDeclRange> ranges_;
94 class SP_API CharsetDecl {
97 void addSection(const PublicId &);
98 void swap(CharsetDecl &);
100 void usedSet(ISet<Char> &) const;
101 void declaredSet(ISet<WideChar> &set) const;
102 Boolean charDeclared(WideChar) const;
103 void rangeDeclared(WideChar min, Number count,
104 ISet<WideChar> &declared) const;
105 void addRange(WideChar, Number, WideChar);
106 void addRange(WideChar, Number);
107 void addRange(WideChar, Number, const StringC &);
108 Boolean getCharInfo(WideChar fromChar,
110 CharsetDeclRange::Type &type,
113 Boolean getCharInfo(WideChar fromChar,
115 CharsetDeclRange::Type &type,
118 Number &count) const;
119 void stringToChar(const StringC &str, ISet<WideChar> &to) const;
120 void numberToChar(const PublicId *id, Number n,
121 ISet<WideChar> &to, Number &count) const;
122 void numberToChar(const PublicId *id, Number n, ISet<WideChar> &to) const;
124 Vector<CharsetDeclSection> sections_;
125 ISet<WideChar> declaredSet_;
129 Boolean CharsetDecl::getCharInfo(WideChar fromChar,
131 CharsetDeclRange::Type &type,
136 return getCharInfo(fromChar, id, type, n, str, tem);
140 void CharsetDecl::numberToChar(const PublicId *id, Number n,
141 ISet<WideChar> &to) const
144 numberToChar(id, n, to, tem);
148 void CharsetDecl::declaredSet(ISet<WideChar> &set) const
154 Boolean CharsetDecl::charDeclared(WideChar c) const
156 return declaredSet_.contains(c);
163 #endif /* not CharsetDecl_INCLUDED */