Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / programs / nsgmls / SgmlParser.C
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
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)
10  * any later version.
11  *
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
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: SgmlParser.C /main/1 1996/07/29 17:04:11 cde-hp $ */
24 // Copyright (c) 1994 James Clark
25 // See the file COPYING for copying permission.
26
27 #ifdef __GNUG__
28 #pragma implementation
29 #endif
30
31 #include "splib.h"
32 #include "SgmlParser.h"
33 #include "Parser.h"
34
35 #ifdef SP_NAMESPACE
36 namespace SP_NAMESPACE {
37 #endif
38
39 SgmlParser::SgmlParser()
40 : parser_(0)
41 {
42 }
43
44 SgmlParser::SgmlParser(const Params &params)
45 : parser_(new Parser(params))
46 {
47 }
48
49 void SgmlParser::init(const Params &params)
50 {
51   delete parser_;
52   parser_ = new Parser(params);
53 }
54
55 SgmlParser::~SgmlParser()
56 {
57   delete parser_;
58 }
59
60 Event *SgmlParser::nextEvent()
61 {
62   return parser_->nextEvent();
63 }
64
65 void SgmlParser::parseAll(EventHandler &handler,
66                           SP_CONST SP_VOLATILE sig_atomic_t *cancelPtr)
67 {
68   parser_->parseAll(handler, cancelPtr);
69 }
70
71 ConstPtr<Sd> SgmlParser::sd() const
72 {
73   return parser_->sdPointer();
74 }
75
76 ConstPtr<Syntax> SgmlParser::instanceSyntax() const
77 {
78   return parser_->instanceSyntaxPointer();
79 }
80
81 ConstPtr<Syntax> SgmlParser::prologSyntax() const
82 {
83   return parser_->prologSyntaxPointer();
84 }
85
86 const EntityManager &SgmlParser::entityManager() const
87 {
88   return parser_->entityManager();
89 }
90
91 const EntityCatalog &SgmlParser::entityCatalog() const
92 {
93   return parser_->entityCatalog();
94 }
95
96 void SgmlParser::activateLinkType(const StringC &name)
97 {
98   parser_->activateLinkType(name);
99 }
100
101 void SgmlParser::allLinkTypesActivated()
102 {
103   parser_->allLinkTypesActivated();
104 }
105
106 void SgmlParser::swap(SgmlParser &s)
107 {
108   Parser *tem = parser_;
109   parser_ = s.parser_;
110   s.parser_ = tem;
111 }
112
113 Ptr<Dtd> SgmlParser::baseDtd()
114 {
115   return parser_->baseDtd();
116 }
117
118 const ParserOptions &SgmlParser::options() const
119 {
120   return parser_->options();
121 }
122
123 SgmlParser::Params::Params()
124 : entityType(document),
125   initialCharset(0),
126   parent(0),
127   options(0),
128   subdocInheritActiveLinkTypes(0),
129   subdocReferenced(0),
130   subdocLevel(0)
131 {
132 }
133
134 #ifdef SP_NAMESPACE
135 }
136 #endif