1 // Copyright (c) 1995 James Clark
2 // See the file COPYING for copying permission.
3 
4 #ifdef __GNUG__
5 #pragma implementation
6 #endif
7 
8 #include "splib.h"
9 #include "Boolean.h"
10 #include "SGMLApplication.h"
11 
~SGMLApplication()12 SGMLApplication::~SGMLApplication()
13 {
14 }
15 
appinfo(const AppinfoEvent &)16 void SGMLApplication::appinfo(const AppinfoEvent &)
17 {
18 }
19 
startDtd(const StartDtdEvent &)20 void SGMLApplication::startDtd(const StartDtdEvent &)
21 {
22 }
23 
endDtd(const EndDtdEvent &)24 void SGMLApplication::endDtd(const EndDtdEvent &)
25 {
26 }
27 
endProlog(const EndPrologEvent &)28 void SGMLApplication::endProlog(const EndPrologEvent &)
29 {
30 }
31 
startElement(const StartElementEvent &)32 void SGMLApplication::startElement(const StartElementEvent &)
33 {
34 }
35 
endElement(const EndElementEvent &)36 void SGMLApplication::endElement(const EndElementEvent &)
37 {
38 }
39 
data(const DataEvent &)40 void SGMLApplication::data(const DataEvent &)
41 {
42 }
43 
sdata(const SdataEvent &)44 void SGMLApplication::sdata(const SdataEvent &)
45 {
46 }
47 
pi(const PiEvent &)48 void SGMLApplication::pi(const PiEvent &)
49 {
50 }
51 
externalDataEntityRef(const ExternalDataEntityRefEvent &)52 void SGMLApplication::externalDataEntityRef(const ExternalDataEntityRefEvent &)
53 {
54 }
55 
subdocEntityRef(const SubdocEntityRefEvent &)56 void SGMLApplication::subdocEntityRef(const SubdocEntityRefEvent &)
57 {
58 }
59 
nonSgmlChar(const NonSgmlCharEvent &)60 void SGMLApplication::nonSgmlChar(const NonSgmlCharEvent &)
61 {
62 }
63 
commentDecl(const CommentDeclEvent &)64 void SGMLApplication::commentDecl(const CommentDeclEvent &)
65 {
66 }
67 
markedSectionStart(const MarkedSectionStartEvent &)68 void SGMLApplication::markedSectionStart(const MarkedSectionStartEvent &)
69 {
70 }
71 
markedSectionEnd(const MarkedSectionEndEvent &)72 void SGMLApplication::markedSectionEnd(const MarkedSectionEndEvent &)
73 {
74 }
75 
ignoredChars(const IgnoredCharsEvent &)76 void SGMLApplication::ignoredChars(const IgnoredCharsEvent &)
77 {
78 }
79 
generalEntity(const GeneralEntityEvent &)80 void SGMLApplication::generalEntity(const GeneralEntityEvent &)
81 {
82 }
83 
error(const ErrorEvent &)84 void SGMLApplication::error(const ErrorEvent &)
85 {
86 }
87 
openEntityChange(const OpenEntityPtr &)88 void SGMLApplication::openEntityChange(const OpenEntityPtr &)
89 {
90 }
91 
92 
OpenEntity()93 SGMLApplication::OpenEntity::OpenEntity()
94 : count_(0)
95 {
96 }
97 
~OpenEntity()98 SGMLApplication::OpenEntity::~OpenEntity()
99 {
100 }
101 
OpenEntityPtr()102 SGMLApplication::OpenEntityPtr::OpenEntityPtr()
103 : ptr_(0)
104 {
105 }
106 
OpenEntityPtr(const OpenEntityPtr & ptr)107 SGMLApplication::OpenEntityPtr::OpenEntityPtr(const OpenEntityPtr &ptr)
108 : ptr_(ptr.ptr_)
109 {
110   if (ptr_)
111     ptr_->count_ += 1;
112 }
113 
~OpenEntityPtr()114 SGMLApplication::OpenEntityPtr::~OpenEntityPtr()
115 {
116   if (ptr_) {
117     ptr_->count_ -= 1;
118     if (ptr_->count_ == 0)
119       delete ptr_;
120   }
121 }
122 
operator =(OpenEntity * p)123 void SGMLApplication::OpenEntityPtr::operator=(OpenEntity *p)
124 {
125   if (p)
126     p->count_ += 1;
127   if (ptr_) {
128     ptr_->count_ -= 1;
129     if (ptr_->count_ == 0)
130       delete ptr_;
131   }
132   ptr_ = p;
133 }
134 
Location()135 SGMLApplication::Location::Location()
136 {
137   init();
138 }
139 
Location(const OpenEntityPtr & ptr,Position pos)140 SGMLApplication::Location::Location(const OpenEntityPtr &ptr, Position pos)
141 {
142   if (ptr)
143     *this = ptr->location(pos);
144   else
145     init();
146 }
147 
init()148 void SGMLApplication::Location::init()
149 {
150   entityName.ptr = 0;
151   entityName.len = 0;
152   filename.ptr = 0;
153   filename.len = 0;
154   lineNumber = (unsigned long)-1;
155   columnNumber = (unsigned long)-1;
156   byteOffset = (unsigned long)-1;
157   entityOffset = (unsigned long)-1;
158   other = 0;
159 }
160