1
// Copyright (c) 1994 James Clark
2
// See the file COPYING for copying permission.
12
namespace SP_NAMESPACE {
15
Sd::Sd(const Ptr<EntityManager> &entityManager)
16
: entityManager_(entityManager),
17
internalCharsetIsDocCharset_(entityManager->internalCharsetIsDocCharset()),
18
docCharset_(entityManager->charset()),
21
netEnable_(netEnableNo),
22
entityRef_(entityRefAny),
27
for (i = 0; i < nBooleanFeature; i++)
28
booleanFeature_[i] = 0;
29
for (i = 0; i < nNumberFeature; i++)
30
numberFeature_[i] = 0;
31
for (i = 0; i < nCapacity; i++)
33
if (internalCharsetIsDocCharset_)
34
internalCharsetPtr_ = 0;
36
internalCharsetPtr_ = &entityManager->charset();
39
void Sd::setDocCharsetDesc(const UnivCharsetDesc &desc)
41
docCharset_.set(desc);
44
const char *const Sd::reservedName_[] = {
132
const char *const Sd::capacityName_[] = {
153
const char *const Sd::quantityName_[] = {
171
const char *const Sd::generalDelimiterName_[] = {
207
Boolean Sd::lookupQuantityName(const StringC &name, Syntax::Quantity &quantity)
210
for (size_t i = 0; i < SIZEOF(quantityName_); i++)
211
if (execToInternal(quantityName_[i]) == name) {
212
quantity = Syntax::Quantity(i);
218
Boolean Sd::lookupCapacityName(const StringC &name, Sd::Capacity &capacity)
221
for (size_t i = 0; i < SIZEOF(capacityName_); i++)
222
if (execToInternal(capacityName_[i]) == name) {
223
capacity = Sd::Capacity(i);
229
Boolean Sd::lookupGeneralDelimiterName(const StringC &name,
230
Syntax::DelimGeneral &delimGeneral)
233
for (size_t i = 0; i < SIZEOF(generalDelimiterName_); i++)
234
if (execToInternal(generalDelimiterName_[i]) == name) {
235
delimGeneral = Syntax::DelimGeneral(i);
241
StringC Sd::quantityName(Syntax::Quantity q) const
243
return execToInternal(quantityName_[q]);
246
StringC Sd::generalDelimiterName(Syntax::DelimGeneral d) const
248
return execToInternal(generalDelimiterName_[d]);
251
UnivChar Sd::nameToUniv(const StringC &name)
253
const int *p = namedCharTable_.lookup(name);
258
n = int(namedCharTable_.count());
259
namedCharTable_.insert(name, n);
261
return n + 0x60000000; // 10646 private use group
264
void Sd::setShorttag(Boolean b)
266
for (int i = fSHORTTAG_FIRST; i <= fSHORTTAG_LAST; i++)
267
booleanFeature_[i] = b;
268
netEnable_ = netEnableAll;