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 libraries 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: Sd.C /main/1 1996/07/29 17:03:39 cde-hp $ */
24 // Copyright (c) 1994 James Clark
25 // See the file COPYING for copying permission.
28 #pragma implementation
35 namespace SP_NAMESPACE {
42 for (i = 0; i < nBooleanFeature; i++)
43 booleanFeature_[i] = 0;
44 for (i = 0; i < nNumberFeature; i++)
45 numberFeature_[i] = 0;
46 for (i = 0; i < nCapacity; i++)
50 void Sd::setDocCharsetDesc(const UnivCharsetDesc &desc)
52 docCharset_.set(desc);
55 const char *const Sd::reservedName_[] = {
112 const char *const Sd::capacityName_[] = {
133 const char *const Sd::quantityName_[] = {
151 const char *const Sd::generalDelimiterName_[] = {
185 Boolean Sd::lookupQuantityName(const StringC &name, Syntax::Quantity &quantity)
188 for (size_t i = 0; i < SIZEOF(quantityName_); i++)
189 if (execToDoc(quantityName_[i]) == name) {
190 quantity = Syntax::Quantity(i);
196 Boolean Sd::lookupCapacityName(const StringC &name, Sd::Capacity &capacity)
199 for (size_t i = 0; i < SIZEOF(capacityName_); i++)
200 if (execToDoc(capacityName_[i]) == name) {
201 capacity = Sd::Capacity(i);
207 Boolean Sd::lookupGeneralDelimiterName(const StringC &name,
208 Syntax::DelimGeneral &delimGeneral)
211 for (size_t i = 0; i < SIZEOF(generalDelimiterName_); i++)
212 if (execToDoc(generalDelimiterName_[i]) == name) {
213 delimGeneral = Syntax::DelimGeneral(i);
219 StringC Sd::quantityName(Syntax::Quantity q) const
221 return execToDoc(quantityName_[q]);
224 StringC Sd::generalDelimiterName(Syntax::DelimGeneral d) const
226 return execToDoc(generalDelimiterName_[d]);
229 UnivChar Sd::nameToUniv(const StringC &name)
231 const int *p = namedCharTable_.lookup(name);
236 n = int(namedCharTable_.count());
237 namedCharTable_.insert(name, n);
239 return n + 0x60000000; // 10646 private use group