1 /* $XConsortium: CharsetDecl.h /main/1 1996/07/29 16:47:13 cde-hp $ */
2 // Copyright (c) 1994 James Clark
3 // See the file COPYING for copying permission.
5 #ifndef CharsetDecl_INCLUDED
6 #define CharsetDecl_INCLUDED 1
13 #include "ExternalId.h"
18 namespace SP_NAMESPACE {
21 class SP_API CharsetDeclRange {
29 CharsetDeclRange(WideChar, Number, WideChar);
30 CharsetDeclRange(WideChar, Number);
31 CharsetDeclRange(WideChar, Number, const StringC &);
32 void rangeDeclared(WideChar min, Number count,
33 ISet<WideChar> &declared) const;
34 void usedSet(ISet<Char> &) const;
35 Boolean getCharInfo(WideChar fromChar,
36 CharsetDeclRange::Type &type,
40 void stringToChar(const StringC &str, ISet<WideChar> &to) const;
41 void numberToChar(Number n, ISet<WideChar> &to, Number &count) const;
50 class SP_API CharsetDeclSection {
53 void setPublicId(const PublicId &);
54 void addRange(const CharsetDeclRange &);
55 void rangeDeclared(WideChar min, Number count,
56 ISet<WideChar> &declared) const;
57 void usedSet(ISet<Char> &) const;
58 Boolean getCharInfo(WideChar fromChar,
60 CharsetDeclRange::Type &type,
64 void stringToChar(const StringC &str, ISet<WideChar> &to) const;
65 void numberToChar(const PublicId *id, Number n,
66 ISet<WideChar> &to, Number &count) const;
69 Vector<CharsetDeclRange> ranges_;
72 class SP_API CharsetDecl {
75 void addSection(const PublicId &);
76 void swap(CharsetDecl &);
78 void usedSet(ISet<Char> &) const;
79 void declaredSet(ISet<WideChar> &set) const;
80 Boolean charDeclared(WideChar) const;
81 void rangeDeclared(WideChar min, Number count,
82 ISet<WideChar> &declared) const;
83 void addRange(WideChar, Number, WideChar);
84 void addRange(WideChar, Number);
85 void addRange(WideChar, Number, const StringC &);
86 Boolean getCharInfo(WideChar fromChar,
88 CharsetDeclRange::Type &type,
91 Boolean getCharInfo(WideChar fromChar,
93 CharsetDeclRange::Type &type,
97 void stringToChar(const StringC &str, ISet<WideChar> &to) const;
98 void numberToChar(const PublicId *id, Number n,
99 ISet<WideChar> &to, Number &count) const;
100 void numberToChar(const PublicId *id, Number n, ISet<WideChar> &to) const;
102 Vector<CharsetDeclSection> sections_;
103 ISet<WideChar> declaredSet_;
107 Boolean CharsetDecl::getCharInfo(WideChar fromChar,
109 CharsetDeclRange::Type &type,
114 return getCharInfo(fromChar, id, type, n, str, tem);
118 void CharsetDecl::numberToChar(const PublicId *id, Number n,
119 ISet<WideChar> &to) const
122 numberToChar(id, n, to, tem);
126 void CharsetDecl::declaredSet(ISet<WideChar> &set) const
132 Boolean CharsetDecl::charDeclared(WideChar c) const
134 return declaredSet_.contains(c);
141 #endif /* not CharsetDecl_INCLUDED */