1*0Sstevel@tonic-gate // Copyright (c) 1994 James Clark
2*0Sstevel@tonic-gate // See the file COPYING for copying permission.
3*0Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI"
4*0Sstevel@tonic-gate
5*0Sstevel@tonic-gate #ifndef Dtd_INCLUDED
6*0Sstevel@tonic-gate #define Dtd_INCLUDED 1
7*0Sstevel@tonic-gate #ifdef __GNUG__
8*0Sstevel@tonic-gate #pragma interface
9*0Sstevel@tonic-gate #endif
10*0Sstevel@tonic-gate
11*0Sstevel@tonic-gate #include "NamedTable.h"
12*0Sstevel@tonic-gate #include "NamedResourceTable.h"
13*0Sstevel@tonic-gate #include "ElementType.h"
14*0Sstevel@tonic-gate #include "Notation.h"
15*0Sstevel@tonic-gate #include "Entity.h"
16*0Sstevel@tonic-gate #include "ShortReferenceMap.h"
17*0Sstevel@tonic-gate #include "Resource.h"
18*0Sstevel@tonic-gate #include "StringC.h"
19*0Sstevel@tonic-gate #include "StringResource.h"
20*0Sstevel@tonic-gate #include "Boolean.h"
21*0Sstevel@tonic-gate #include "Vector.h"
22*0Sstevel@tonic-gate #include "HashTable.h"
23*0Sstevel@tonic-gate
24*0Sstevel@tonic-gate #ifdef SP_NAMESPACE
25*0Sstevel@tonic-gate namespace SP_NAMESPACE {
26*0Sstevel@tonic-gate #endif
27*0Sstevel@tonic-gate
28*0Sstevel@tonic-gate class Syntax;
29*0Sstevel@tonic-gate class ParserState;
30*0Sstevel@tonic-gate
31*0Sstevel@tonic-gate class SP_API Dtd : public Resource {
32*0Sstevel@tonic-gate public:
33*0Sstevel@tonic-gate typedef NamedTableIter<ElementType> ElementTypeIter;
34*0Sstevel@tonic-gate typedef ConstNamedTableIter<ElementType> ConstElementTypeIter;
35*0Sstevel@tonic-gate typedef NamedTableIter<ShortReferenceMap> ShortReferenceMapIter;
36*0Sstevel@tonic-gate typedef ConstNamedResourceTableIter<Notation> ConstNotationIter;
37*0Sstevel@tonic-gate typedef NamedResourceTableIter<Notation> NotationIter;
38*0Sstevel@tonic-gate typedef ConstNamedResourceTableIter<Entity> ConstEntityIter;
39*0Sstevel@tonic-gate typedef NamedResourceTableIter<Entity> EntityIter;
40*0Sstevel@tonic-gate Dtd(const StringC &name, Boolean isBase);
41*0Sstevel@tonic-gate ConstPtr<Entity> lookupEntity(Boolean isParameter, const StringC &) const;
42*0Sstevel@tonic-gate const Entity *lookupEntityTemp(Boolean isParameter, const StringC &) const;
43*0Sstevel@tonic-gate Ptr<Entity> lookupEntity(Boolean isParameter, const StringC &);
44*0Sstevel@tonic-gate Ptr<Entity> insertEntity(const Ptr<Entity> &, Boolean replace = 0);
45*0Sstevel@tonic-gate Ptr<Entity> removeEntity(Boolean isParameter, const StringC &);
46*0Sstevel@tonic-gate ConstEntityIter generalEntityIter() const;
47*0Sstevel@tonic-gate EntityIter generalEntityIter();
48*0Sstevel@tonic-gate ConstEntityIter parameterEntityIter() const;
49*0Sstevel@tonic-gate EntityIter parameterEntityIter();
50*0Sstevel@tonic-gate
51*0Sstevel@tonic-gate ConstPtr<Entity> defaultEntity() const;
52*0Sstevel@tonic-gate const Entity *defaultEntityTemp() const;
53*0Sstevel@tonic-gate void setDefaultEntity(const Ptr<Entity> &, ParserState &);
54*0Sstevel@tonic-gate const ConstPtr<StringResource<Char> > &namePointer() const;
55*0Sstevel@tonic-gate const StringC &name() const;
56*0Sstevel@tonic-gate
57*0Sstevel@tonic-gate const ElementType *lookupElementType(const StringC &) const;
58*0Sstevel@tonic-gate ElementType *lookupElementType(const StringC &);
59*0Sstevel@tonic-gate ElementType *removeElementType(const StringC &);
60*0Sstevel@tonic-gate ElementType *insertElementType(ElementType *);
61*0Sstevel@tonic-gate ElementType *insertUndefinedElementType(ElementType *);
62*0Sstevel@tonic-gate size_t nElementTypeIndex() const;
63*0Sstevel@tonic-gate size_t allocElementTypeIndex();
64*0Sstevel@tonic-gate ConstElementTypeIter elementTypeIter() const;
65*0Sstevel@tonic-gate ElementTypeIter elementTypeIter();
66*0Sstevel@tonic-gate
67*0Sstevel@tonic-gate const RankStem *lookupRankStem(const StringC &) const;
68*0Sstevel@tonic-gate RankStem *lookupRankStem(const StringC &);
69*0Sstevel@tonic-gate RankStem *insertRankStem(RankStem *);
70*0Sstevel@tonic-gate size_t nRankStem() const;
71*0Sstevel@tonic-gate
72*0Sstevel@tonic-gate const ShortReferenceMap *lookupShortReferenceMap(const StringC &) const;
73*0Sstevel@tonic-gate ShortReferenceMap *lookupShortReferenceMap(const StringC &);
74*0Sstevel@tonic-gate ShortReferenceMap *insertShortReferenceMap(ShortReferenceMap *);
75*0Sstevel@tonic-gate ShortReferenceMapIter shortReferenceMapIter();
76*0Sstevel@tonic-gate
77*0Sstevel@tonic-gate Boolean shortrefIndex(const StringC &, const Syntax &, size_t &index);
78*0Sstevel@tonic-gate size_t nShortref() const;
79*0Sstevel@tonic-gate const StringC &shortref(size_t i) const;
80*0Sstevel@tonic-gate void addNeededShortref(const StringC &);
81*0Sstevel@tonic-gate
82*0Sstevel@tonic-gate ConstPtr<Notation> lookupNotation(const StringC &) const;
83*0Sstevel@tonic-gate const Notation *lookupNotationTemp(const StringC &) const;
84*0Sstevel@tonic-gate Ptr<Notation> lookupNotation(const StringC &);
85*0Sstevel@tonic-gate Ptr<Notation> insertNotation(const Ptr<Notation> &);
86*0Sstevel@tonic-gate Ptr<Notation> removeNotation(const StringC &);
87*0Sstevel@tonic-gate ConstNotationIter notationIter() const;
88*0Sstevel@tonic-gate NotationIter notationIter();
89*0Sstevel@tonic-gate
90*0Sstevel@tonic-gate size_t allocCurrentAttributeIndex();
91*0Sstevel@tonic-gate size_t nCurrentAttribute() const;
92*0Sstevel@tonic-gate size_t allocElementDefinitionIndex();
93*0Sstevel@tonic-gate size_t nElementDefinition() const;
94*0Sstevel@tonic-gate size_t allocAttributeDefinitionListIndex();
95*0Sstevel@tonic-gate size_t nAttributeDefinitionList() const;
96*0Sstevel@tonic-gate const ElementType *documentElementType() const;
97*0Sstevel@tonic-gate Boolean isBase() const;
98*0Sstevel@tonic-gate
99*0Sstevel@tonic-gate Ptr<AttributeDefinitionList> &implicitElementAttributeDef();
100*0Sstevel@tonic-gate void setImplicitElementAttributeDef(const Ptr<AttributeDefinitionList> &);
101*0Sstevel@tonic-gate Ptr<AttributeDefinitionList> &implicitNotationAttributeDef();
102*0Sstevel@tonic-gate void setImplicitNotationAttributeDef(const Ptr<AttributeDefinitionList> &);
103*0Sstevel@tonic-gate private:
104*0Sstevel@tonic-gate Dtd(const Dtd &); // undefined
105*0Sstevel@tonic-gate void operator=(const Dtd &); // undefined
106*0Sstevel@tonic-gate NamedResourceTable<Entity> generalEntityTable_;
107*0Sstevel@tonic-gate NamedResourceTable<Entity> parameterEntityTable_;
108*0Sstevel@tonic-gate ConstPtr<Entity> defaultEntity_;
109*0Sstevel@tonic-gate ConstPtr<StringResource<Char> > name_;
110*0Sstevel@tonic-gate NamedTable<ElementType> elementTypeTable_;
111*0Sstevel@tonic-gate NamedTable<ElementType> undefinedElementTypeTable_;
112*0Sstevel@tonic-gate NamedTable<RankStem> rankStemTable_;
113*0Sstevel@tonic-gate NamedTable<ShortReferenceMap> shortReferenceMapTable_;
114*0Sstevel@tonic-gate NamedResourceTable<Notation> notationTable_;
115*0Sstevel@tonic-gate size_t nCurrentAttribute_;
116*0Sstevel@tonic-gate size_t nElementDefinition_;
117*0Sstevel@tonic-gate size_t nAttributeDefinitionList_;
118*0Sstevel@tonic-gate size_t nElementType_;
119*0Sstevel@tonic-gate ElementType *documentElementType_;
120*0Sstevel@tonic-gate Vector<StringC> shortrefs_;
121*0Sstevel@tonic-gate HashTable<StringC,int> shortrefTable_;
122*0Sstevel@tonic-gate Boolean isBase_;
123*0Sstevel@tonic-gate Ptr<AttributeDefinitionList> implicitElementAttributeDef_;
124*0Sstevel@tonic-gate Ptr<AttributeDefinitionList> implicitNotationAttributeDef_;
125*0Sstevel@tonic-gate };
126*0Sstevel@tonic-gate
127*0Sstevel@tonic-gate inline
lookupEntity(Boolean isParameter,const StringC & name)128*0Sstevel@tonic-gate ConstPtr<Entity> Dtd::lookupEntity(Boolean isParameter, const StringC &name)
129*0Sstevel@tonic-gate const
130*0Sstevel@tonic-gate {
131*0Sstevel@tonic-gate return (isParameter
132*0Sstevel@tonic-gate ? ¶meterEntityTable_
133*0Sstevel@tonic-gate : &generalEntityTable_)->lookupConst(name);
134*0Sstevel@tonic-gate }
135*0Sstevel@tonic-gate
136*0Sstevel@tonic-gate inline
lookupEntityTemp(Boolean isParameter,const StringC & name)137*0Sstevel@tonic-gate const Entity *Dtd::lookupEntityTemp(Boolean isParameter, const StringC &name)
138*0Sstevel@tonic-gate const
139*0Sstevel@tonic-gate {
140*0Sstevel@tonic-gate return (isParameter
141*0Sstevel@tonic-gate ? ¶meterEntityTable_
142*0Sstevel@tonic-gate : &generalEntityTable_)->lookupTemp(name);
143*0Sstevel@tonic-gate }
144*0Sstevel@tonic-gate
145*0Sstevel@tonic-gate inline
lookupEntity(Boolean isParameter,const StringC & name)146*0Sstevel@tonic-gate Ptr<Entity> Dtd::lookupEntity(Boolean isParameter, const StringC &name)
147*0Sstevel@tonic-gate {
148*0Sstevel@tonic-gate return (isParameter
149*0Sstevel@tonic-gate ? ¶meterEntityTable_
150*0Sstevel@tonic-gate : &generalEntityTable_)->lookup(name);
151*0Sstevel@tonic-gate }
152*0Sstevel@tonic-gate
153*0Sstevel@tonic-gate inline
154*0Sstevel@tonic-gate Ptr<Entity>
insertEntity(const Ptr<Entity> & entity,Boolean replace)155*0Sstevel@tonic-gate Dtd::insertEntity(const Ptr<Entity> &entity, Boolean replace)
156*0Sstevel@tonic-gate {
157*0Sstevel@tonic-gate return (entity->declType() == Entity::parameterEntity
158*0Sstevel@tonic-gate ? ¶meterEntityTable_
159*0Sstevel@tonic-gate : &generalEntityTable_)->insert(entity, replace);
160*0Sstevel@tonic-gate }
161*0Sstevel@tonic-gate
162*0Sstevel@tonic-gate inline
removeEntity(Boolean isParameter,const StringC & name)163*0Sstevel@tonic-gate Ptr<Entity> Dtd::removeEntity(Boolean isParameter, const StringC &name)
164*0Sstevel@tonic-gate {
165*0Sstevel@tonic-gate return (isParameter
166*0Sstevel@tonic-gate ? ¶meterEntityTable_
167*0Sstevel@tonic-gate : &generalEntityTable_)->remove(name);
168*0Sstevel@tonic-gate }
169*0Sstevel@tonic-gate
170*0Sstevel@tonic-gate inline
generalEntityIter()171*0Sstevel@tonic-gate Dtd::ConstEntityIter Dtd::generalEntityIter() const
172*0Sstevel@tonic-gate {
173*0Sstevel@tonic-gate // Avoid use of typedef to work around MSVC 2.0 bug.
174*0Sstevel@tonic-gate return ConstNamedResourceTableIter<Entity>(generalEntityTable_);
175*0Sstevel@tonic-gate }
176*0Sstevel@tonic-gate
177*0Sstevel@tonic-gate inline
generalEntityIter()178*0Sstevel@tonic-gate Dtd::EntityIter Dtd::generalEntityIter()
179*0Sstevel@tonic-gate {
180*0Sstevel@tonic-gate // Avoid use of typedef to work around MSVC 2.0 bug.
181*0Sstevel@tonic-gate return NamedResourceTableIter<Entity>(generalEntityTable_);
182*0Sstevel@tonic-gate }
183*0Sstevel@tonic-gate
184*0Sstevel@tonic-gate inline
parameterEntityIter()185*0Sstevel@tonic-gate Dtd::ConstEntityIter Dtd::parameterEntityIter() const
186*0Sstevel@tonic-gate {
187*0Sstevel@tonic-gate // Avoid use of typedef to work around MSVC 2.0 bug.
188*0Sstevel@tonic-gate return ConstNamedResourceTableIter<Entity>(parameterEntityTable_);
189*0Sstevel@tonic-gate }
190*0Sstevel@tonic-gate
191*0Sstevel@tonic-gate inline
parameterEntityIter()192*0Sstevel@tonic-gate Dtd::EntityIter Dtd::parameterEntityIter()
193*0Sstevel@tonic-gate {
194*0Sstevel@tonic-gate // Avoid use of typedef to work around MSVC 2.0 bug.
195*0Sstevel@tonic-gate return NamedResourceTableIter<Entity>(parameterEntityTable_);
196*0Sstevel@tonic-gate }
197*0Sstevel@tonic-gate
198*0Sstevel@tonic-gate inline
defaultEntity()199*0Sstevel@tonic-gate ConstPtr<Entity> Dtd::defaultEntity() const
200*0Sstevel@tonic-gate {
201*0Sstevel@tonic-gate return defaultEntity_;
202*0Sstevel@tonic-gate }
203*0Sstevel@tonic-gate
204*0Sstevel@tonic-gate inline
defaultEntityTemp()205*0Sstevel@tonic-gate const Entity *Dtd::defaultEntityTemp() const
206*0Sstevel@tonic-gate {
207*0Sstevel@tonic-gate return defaultEntity_.pointer();
208*0Sstevel@tonic-gate }
209*0Sstevel@tonic-gate
210*0Sstevel@tonic-gate inline
namePointer()211*0Sstevel@tonic-gate const ConstPtr<StringResource<Char> > &Dtd::namePointer() const
212*0Sstevel@tonic-gate {
213*0Sstevel@tonic-gate return name_;
214*0Sstevel@tonic-gate }
215*0Sstevel@tonic-gate
216*0Sstevel@tonic-gate inline
name()217*0Sstevel@tonic-gate const StringC &Dtd::name() const
218*0Sstevel@tonic-gate {
219*0Sstevel@tonic-gate return *name_;
220*0Sstevel@tonic-gate }
221*0Sstevel@tonic-gate
222*0Sstevel@tonic-gate inline
allocCurrentAttributeIndex()223*0Sstevel@tonic-gate size_t Dtd::allocCurrentAttributeIndex()
224*0Sstevel@tonic-gate {
225*0Sstevel@tonic-gate return nCurrentAttribute_++;
226*0Sstevel@tonic-gate }
227*0Sstevel@tonic-gate
228*0Sstevel@tonic-gate inline
nCurrentAttribute()229*0Sstevel@tonic-gate size_t Dtd::nCurrentAttribute() const
230*0Sstevel@tonic-gate {
231*0Sstevel@tonic-gate return nCurrentAttribute_;
232*0Sstevel@tonic-gate }
233*0Sstevel@tonic-gate
234*0Sstevel@tonic-gate inline
allocElementDefinitionIndex()235*0Sstevel@tonic-gate size_t Dtd::allocElementDefinitionIndex()
236*0Sstevel@tonic-gate {
237*0Sstevel@tonic-gate return nElementDefinition_++;
238*0Sstevel@tonic-gate }
239*0Sstevel@tonic-gate
240*0Sstevel@tonic-gate inline
nElementDefinition()241*0Sstevel@tonic-gate size_t Dtd::nElementDefinition() const
242*0Sstevel@tonic-gate {
243*0Sstevel@tonic-gate return nElementDefinition_;
244*0Sstevel@tonic-gate }
245*0Sstevel@tonic-gate
246*0Sstevel@tonic-gate inline
allocAttributeDefinitionListIndex()247*0Sstevel@tonic-gate size_t Dtd::allocAttributeDefinitionListIndex()
248*0Sstevel@tonic-gate {
249*0Sstevel@tonic-gate return nAttributeDefinitionList_++;
250*0Sstevel@tonic-gate }
251*0Sstevel@tonic-gate
252*0Sstevel@tonic-gate inline
nAttributeDefinitionList()253*0Sstevel@tonic-gate size_t Dtd::nAttributeDefinitionList() const
254*0Sstevel@tonic-gate {
255*0Sstevel@tonic-gate return nAttributeDefinitionList_;
256*0Sstevel@tonic-gate }
257*0Sstevel@tonic-gate
258*0Sstevel@tonic-gate inline
lookupElementType(const StringC & name)259*0Sstevel@tonic-gate const ElementType *Dtd::lookupElementType(const StringC &name) const
260*0Sstevel@tonic-gate {
261*0Sstevel@tonic-gate const ElementType *e = elementTypeTable_.lookup(name);
262*0Sstevel@tonic-gate if (e)
263*0Sstevel@tonic-gate return e;
264*0Sstevel@tonic-gate else
265*0Sstevel@tonic-gate return undefinedElementTypeTable_.lookup(name);
266*0Sstevel@tonic-gate }
267*0Sstevel@tonic-gate
268*0Sstevel@tonic-gate inline
lookupElementType(const StringC & name)269*0Sstevel@tonic-gate ElementType *Dtd::lookupElementType(const StringC &name)
270*0Sstevel@tonic-gate {
271*0Sstevel@tonic-gate ElementType *e = elementTypeTable_.lookup(name);
272*0Sstevel@tonic-gate if (e)
273*0Sstevel@tonic-gate return e;
274*0Sstevel@tonic-gate else
275*0Sstevel@tonic-gate return undefinedElementTypeTable_.lookup(name);
276*0Sstevel@tonic-gate }
277*0Sstevel@tonic-gate
278*0Sstevel@tonic-gate inline
insertElementType(ElementType * e)279*0Sstevel@tonic-gate ElementType *Dtd::insertElementType(ElementType *e)
280*0Sstevel@tonic-gate {
281*0Sstevel@tonic-gate return elementTypeTable_.insert(e);
282*0Sstevel@tonic-gate }
283*0Sstevel@tonic-gate
284*0Sstevel@tonic-gate inline
insertUndefinedElementType(ElementType * e)285*0Sstevel@tonic-gate ElementType *Dtd::insertUndefinedElementType(ElementType *e)
286*0Sstevel@tonic-gate {
287*0Sstevel@tonic-gate return undefinedElementTypeTable_.insert(e);
288*0Sstevel@tonic-gate }
289*0Sstevel@tonic-gate
290*0Sstevel@tonic-gate inline
elementTypeIter()291*0Sstevel@tonic-gate Dtd::ElementTypeIter Dtd::elementTypeIter()
292*0Sstevel@tonic-gate {
293*0Sstevel@tonic-gate // Avoid use of typedef to work around MSVC 2.0 bug.
294*0Sstevel@tonic-gate return NamedTableIter<ElementType>(elementTypeTable_);
295*0Sstevel@tonic-gate }
296*0Sstevel@tonic-gate
297*0Sstevel@tonic-gate inline
elementTypeIter()298*0Sstevel@tonic-gate Dtd::ConstElementTypeIter Dtd::elementTypeIter() const
299*0Sstevel@tonic-gate {
300*0Sstevel@tonic-gate // Avoid use of typedef to work around MSVC 2.0 bug.
301*0Sstevel@tonic-gate return ConstNamedTableIter<ElementType>(elementTypeTable_);
302*0Sstevel@tonic-gate }
303*0Sstevel@tonic-gate
304*0Sstevel@tonic-gate inline
removeElementType(const StringC & name)305*0Sstevel@tonic-gate ElementType *Dtd::removeElementType(const StringC &name)
306*0Sstevel@tonic-gate {
307*0Sstevel@tonic-gate return elementTypeTable_.remove(name);
308*0Sstevel@tonic-gate }
309*0Sstevel@tonic-gate
310*0Sstevel@tonic-gate inline
nElementTypeIndex()311*0Sstevel@tonic-gate size_t Dtd::nElementTypeIndex() const
312*0Sstevel@tonic-gate {
313*0Sstevel@tonic-gate // index 0 is reserved for #pcdata
314*0Sstevel@tonic-gate return 1 + nElementType_;
315*0Sstevel@tonic-gate }
316*0Sstevel@tonic-gate
317*0Sstevel@tonic-gate inline
allocElementTypeIndex()318*0Sstevel@tonic-gate size_t Dtd::allocElementTypeIndex()
319*0Sstevel@tonic-gate {
320*0Sstevel@tonic-gate return 1 + nElementType_++;
321*0Sstevel@tonic-gate }
322*0Sstevel@tonic-gate
323*0Sstevel@tonic-gate inline
lookupRankStem(const StringC & name)324*0Sstevel@tonic-gate const RankStem *Dtd::lookupRankStem(const StringC &name) const
325*0Sstevel@tonic-gate {
326*0Sstevel@tonic-gate return rankStemTable_.lookup(name);
327*0Sstevel@tonic-gate }
328*0Sstevel@tonic-gate
329*0Sstevel@tonic-gate inline
lookupRankStem(const StringC & name)330*0Sstevel@tonic-gate RankStem *Dtd::lookupRankStem(const StringC &name)
331*0Sstevel@tonic-gate {
332*0Sstevel@tonic-gate return rankStemTable_.lookup(name);
333*0Sstevel@tonic-gate }
334*0Sstevel@tonic-gate
335*0Sstevel@tonic-gate inline
insertRankStem(RankStem * e)336*0Sstevel@tonic-gate RankStem *Dtd::insertRankStem(RankStem *e)
337*0Sstevel@tonic-gate {
338*0Sstevel@tonic-gate return rankStemTable_.insert(e);
339*0Sstevel@tonic-gate }
340*0Sstevel@tonic-gate
341*0Sstevel@tonic-gate inline
nRankStem()342*0Sstevel@tonic-gate size_t Dtd::nRankStem() const
343*0Sstevel@tonic-gate {
344*0Sstevel@tonic-gate return rankStemTable_.count();
345*0Sstevel@tonic-gate }
346*0Sstevel@tonic-gate
347*0Sstevel@tonic-gate inline
lookupNotation(const StringC & name)348*0Sstevel@tonic-gate ConstPtr<Notation> Dtd::lookupNotation(const StringC &name) const
349*0Sstevel@tonic-gate {
350*0Sstevel@tonic-gate return notationTable_.lookupConst(name);
351*0Sstevel@tonic-gate }
352*0Sstevel@tonic-gate
353*0Sstevel@tonic-gate inline
lookupNotationTemp(const StringC & name)354*0Sstevel@tonic-gate const Notation *Dtd::lookupNotationTemp(const StringC &name) const
355*0Sstevel@tonic-gate {
356*0Sstevel@tonic-gate return notationTable_.lookupTemp(name);
357*0Sstevel@tonic-gate }
358*0Sstevel@tonic-gate
359*0Sstevel@tonic-gate inline
lookupNotation(const StringC & name)360*0Sstevel@tonic-gate Ptr<Notation> Dtd::lookupNotation(const StringC &name)
361*0Sstevel@tonic-gate {
362*0Sstevel@tonic-gate return notationTable_.lookup(name);
363*0Sstevel@tonic-gate }
364*0Sstevel@tonic-gate
365*0Sstevel@tonic-gate inline
insertNotation(const Ptr<Notation> & nt)366*0Sstevel@tonic-gate Ptr<Notation> Dtd::insertNotation(const Ptr<Notation> &nt)
367*0Sstevel@tonic-gate {
368*0Sstevel@tonic-gate return notationTable_.insert(nt);
369*0Sstevel@tonic-gate }
370*0Sstevel@tonic-gate
371*0Sstevel@tonic-gate inline
notationIter()372*0Sstevel@tonic-gate Dtd::ConstNotationIter Dtd::notationIter() const
373*0Sstevel@tonic-gate {
374*0Sstevel@tonic-gate // Avoid use of typedef to work around MSVC 2.0 bug.
375*0Sstevel@tonic-gate return ConstNamedResourceTableIter<Notation>(notationTable_);
376*0Sstevel@tonic-gate }
377*0Sstevel@tonic-gate
378*0Sstevel@tonic-gate inline
notationIter()379*0Sstevel@tonic-gate Dtd::NotationIter Dtd::notationIter()
380*0Sstevel@tonic-gate {
381*0Sstevel@tonic-gate // Avoid use of typedef to work around MSVC 2.0 bug.
382*0Sstevel@tonic-gate return NamedResourceTableIter<Notation>(notationTable_);
383*0Sstevel@tonic-gate }
384*0Sstevel@tonic-gate
385*0Sstevel@tonic-gate inline
removeNotation(const StringC & name)386*0Sstevel@tonic-gate Ptr<Notation> Dtd::removeNotation(const StringC &name)
387*0Sstevel@tonic-gate {
388*0Sstevel@tonic-gate return notationTable_.remove(name);
389*0Sstevel@tonic-gate }
390*0Sstevel@tonic-gate
391*0Sstevel@tonic-gate inline
documentElementType()392*0Sstevel@tonic-gate const ElementType *Dtd::documentElementType() const
393*0Sstevel@tonic-gate {
394*0Sstevel@tonic-gate return documentElementType_;
395*0Sstevel@tonic-gate }
396*0Sstevel@tonic-gate
397*0Sstevel@tonic-gate inline
lookupShortReferenceMap(const StringC & name)398*0Sstevel@tonic-gate const ShortReferenceMap *Dtd::lookupShortReferenceMap(const StringC &name) const
399*0Sstevel@tonic-gate {
400*0Sstevel@tonic-gate return shortReferenceMapTable_.lookup(name);
401*0Sstevel@tonic-gate }
402*0Sstevel@tonic-gate
403*0Sstevel@tonic-gate inline
lookupShortReferenceMap(const StringC & name)404*0Sstevel@tonic-gate ShortReferenceMap *Dtd::lookupShortReferenceMap(const StringC &name)
405*0Sstevel@tonic-gate {
406*0Sstevel@tonic-gate return shortReferenceMapTable_.lookup(name);
407*0Sstevel@tonic-gate }
408*0Sstevel@tonic-gate
409*0Sstevel@tonic-gate inline
insertShortReferenceMap(ShortReferenceMap * map)410*0Sstevel@tonic-gate ShortReferenceMap *Dtd::insertShortReferenceMap(ShortReferenceMap *map)
411*0Sstevel@tonic-gate {
412*0Sstevel@tonic-gate return shortReferenceMapTable_.insert(map);
413*0Sstevel@tonic-gate }
414*0Sstevel@tonic-gate
415*0Sstevel@tonic-gate inline
shortReferenceMapIter()416*0Sstevel@tonic-gate Dtd::ShortReferenceMapIter Dtd::shortReferenceMapIter()
417*0Sstevel@tonic-gate {
418*0Sstevel@tonic-gate // Avoid use of typedef to work around MSVC 2.0 bug.
419*0Sstevel@tonic-gate return NamedTableIter<ShortReferenceMap>(shortReferenceMapTable_);
420*0Sstevel@tonic-gate }
421*0Sstevel@tonic-gate
422*0Sstevel@tonic-gate inline
isBase()423*0Sstevel@tonic-gate Boolean Dtd::isBase() const
424*0Sstevel@tonic-gate {
425*0Sstevel@tonic-gate return isBase_;
426*0Sstevel@tonic-gate }
427*0Sstevel@tonic-gate
428*0Sstevel@tonic-gate inline
nShortref()429*0Sstevel@tonic-gate size_t Dtd::nShortref() const
430*0Sstevel@tonic-gate {
431*0Sstevel@tonic-gate return shortrefs_.size();
432*0Sstevel@tonic-gate }
433*0Sstevel@tonic-gate
434*0Sstevel@tonic-gate inline
shortref(size_t i)435*0Sstevel@tonic-gate const StringC &Dtd::shortref(size_t i) const
436*0Sstevel@tonic-gate {
437*0Sstevel@tonic-gate return shortrefs_[i];
438*0Sstevel@tonic-gate }
439*0Sstevel@tonic-gate
440*0Sstevel@tonic-gate inline
implicitElementAttributeDef()441*0Sstevel@tonic-gate Ptr<AttributeDefinitionList> &Dtd::implicitElementAttributeDef()
442*0Sstevel@tonic-gate {
443*0Sstevel@tonic-gate return implicitElementAttributeDef_;
444*0Sstevel@tonic-gate }
445*0Sstevel@tonic-gate
446*0Sstevel@tonic-gate inline
setImplicitElementAttributeDef(const Ptr<AttributeDefinitionList> & def)447*0Sstevel@tonic-gate void Dtd::setImplicitElementAttributeDef(const Ptr<AttributeDefinitionList> &def)
448*0Sstevel@tonic-gate {
449*0Sstevel@tonic-gate implicitElementAttributeDef_ = def;
450*0Sstevel@tonic-gate }
451*0Sstevel@tonic-gate
452*0Sstevel@tonic-gate inline
implicitNotationAttributeDef()453*0Sstevel@tonic-gate Ptr<AttributeDefinitionList> &Dtd::implicitNotationAttributeDef()
454*0Sstevel@tonic-gate {
455*0Sstevel@tonic-gate return implicitNotationAttributeDef_;
456*0Sstevel@tonic-gate }
457*0Sstevel@tonic-gate
458*0Sstevel@tonic-gate inline
setImplicitNotationAttributeDef(const Ptr<AttributeDefinitionList> & def)459*0Sstevel@tonic-gate void Dtd::setImplicitNotationAttributeDef(const Ptr<AttributeDefinitionList> &def)
460*0Sstevel@tonic-gate {
461*0Sstevel@tonic-gate implicitNotationAttributeDef_ = def;
462*0Sstevel@tonic-gate }
463*0Sstevel@tonic-gate
464*0Sstevel@tonic-gate #ifdef SP_NAMESPACE
465*0Sstevel@tonic-gate }
466*0Sstevel@tonic-gate #endif
467*0Sstevel@tonic-gate
468*0Sstevel@tonic-gate #endif /* not Dtd_INCLUDED */
469