Xalan-C++ API Reference 1.12.0
XSLTInputSource.hpp
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19#if !defined(XALAN_XSLTINPUTSOURCE_HEADER_GUARD)
20#define XALAN_XSLTINPUTSOURCE_HEADER_GUARD
21
22
23
24// Base include file. Must be first.
25#include "XSLTDefinitions.hpp"
26
27
28
29#include <iosfwd>
30
31
32
33#include "xercesc/sax/InputSource.hpp"
34
35
36
38
39
40
41namespace XERCES_CPP_NAMESPACE
42{
43 class Locator;
44}
45
46
47
48namespace XALAN_CPP_NAMESPACE {
49
50
51
52typedef xercesc::BinInputStream BinInputStreamType;
53typedef xercesc::InputSource InputSourceType;
54using xercesc::MemoryManager;
55
56
57class XalanDOMString;
58class XalanNode;
59
60
61
63{
64public:
65
66 typedef std::istream StreamType;
67
68 explicit
69 XSLTInputSource(MemoryManager& theMemoryManager = XalanMemMgrs::getDefault());
70
71 /**
72 * Copy constructor.
73 */
76 MemoryManager& theMemoryManager = XalanMemMgrs::getDefault());
77
78 /**
79 * Assignment operator.
80 */
83
84 /**
85 * Create a new input source with a system identifier.
86 *
87 * <p>Applications may use setPublicId to include a public identifier as
88 * well, or setEncoding to specify the character encoding, if known.</p>
89 *
90 * <p>If the system identifier is a URL, it must be full resolved.</p>
91 *
92 * @param systemId system identifier (URI)
93 * @param theMemoryManager The MemoryManager instance to use.
94 */
96 const XMLCh* systemId,
97 MemoryManager& theMemoryManager = XalanMemMgrs::getDefault());
98
99 /**
100 * Create a new input source with a system identifier.
101 *
102 * <p>Applications may use setPublicId to include a public identifier as
103 * well, or setEncoding to specify the character encoding, if known.</p>
104 *
105 * <p>If the system identifier is a URL, it must be full resolved.</p>
106 *
107 * @param systemId system identifier (URI)
108 * @param theMemoryManager The MemoryManager instance to use.
109 */
112 MemoryManager& theMemoryManager = XalanMemMgrs::getDefault());
113
114 /**
115 * Create a new input source with a system identifier.
116 *
117 * <p>Applications may use setPublicId to include a public identifier as
118 * well, or setEncoding to specify the character encoding, if known.</p>
119 *
120 * <p>If the system identifier is a URL, it must be full resolved.</p>
121 *
122 * @param systemId system identifier (URI)
123 * @param theMemoryManager The MemoryManager instance to use.
124 */
126 const char* systemId,
127 MemoryManager& theMemoryManager = XalanMemMgrs::getDefault());
128
129 /**
130 * Create a new input source with a system identifier and a public
131 * identifier.
132 *
133 * <p>If the system identifier is a URL, it must be full resolved.</p>
134 *
135 * @param systemId system identifier (URI)
136 * @param publicId public identifier
137 * @param theMemoryManager The MemoryManager instance to use.
138 */
140 const char* systemId,
141 const char* publicId,
142 MemoryManager& theMemoryManager = XalanMemMgrs::getDefault());
143
144 /**
145 * Create a new input source with a system identifier and a public
146 * identifier.
147 *
148 * <p>If the system identifier is a URL, it must be full resolved.</p>
149 *
150 * @param systemId system identifier (URI)
151 * @param publicId public identifier
152 * @param theMemoryManager The MemoryManager instance to use.
153 */
155 const XMLCh* systemId,
156 const XMLCh* publicId,
157 MemoryManager& theMemoryManager = XalanMemMgrs::getDefault());
158
159 /**
160 * Create a new input source with a system identifier and a public
161 * identifier.
162 *
163 * <p>If the system identifier is a URL, it must be full resolved.</p>
164 *
165 * @param systemId system identifier (URI)
166 * @param publicId public identifier
167 * @param theMemoryManager The MemoryManager instance to use.
168 */
172 MemoryManager& theMemoryManager = XalanMemMgrs::getDefault());
173
174 /**
175 * Create a new input source with a DOM node.
176 *
177 * <p>Application writers may use setSystemId() to provide a base for
178 * resolving relative URIs, and setPublicId to include a public
179 * identifier.</p>
180 *
181 * @param node DOM node that is root of the document
182 * @param theMemoryManager The MemoryManager instance to use.
183 */
185 XalanNode* node,
186 MemoryManager& theMemoryManager = XalanMemMgrs::getDefault());
187
188 /**
189 * Create a new input source with std stream.
190 *
191 * <p>Application writers may use setSystemId() to provide a base for
192 * resolving relative URIs, and setPublicId to include a public
193 * identifier.</p>
194 *
195 * @param stream the input stream...
196 * @param theMemoryManager The MemoryManager instance to use.
197 */
200 MemoryManager& theMemoryManager = XalanMemMgrs::getDefault());
201
202 /**
203 * Create a new input source with std stream.
204 *
205 * <p>Application writers may use setSystemId() to provide a base for
206 * resolving relative URIs, and setPublicId to include a public
207 * identifier.</p>
208 *
209 * @param stream the input stream...
210 * @param theMemoryManager The MemoryManager instance to use.
211 */
214 MemoryManager& theMemoryManager = XalanMemMgrs::getDefault());
215
216 /**
217 * Makes the byte stream for this input source.
218 *
219 * <p>The SAX parser will ignore this if there is also a character
220 * stream specified, but it will use a byte stream in preference
221 * to opening a URI connection itself.</p>
222 *
223 *
224 * @return pointer to byte stream created
225 */
226 virtual BinInputStreamType*
227 makeStream() const;
228
229 /**
230 * Set the DOM node for this input source.
231 *
232 * @param node DOM node that is root of the document
233 */
234 void
236 {
237 m_node = node;
238 }
239
240 /**
241 * Retrieve the DOM node for this input source.
242 *
243 * @return DOM node that is root of the document
244 */
245 XalanNode*
246 getNode() const
247 {
248 return m_node;
249 }
250
251 StreamType*
252 getStream() const
253 {
254 return m_stream;
255 }
256
257 void
259 {
260 m_stream = stream;
261 }
262
263private:
264
265 StreamType* m_stream;
266
267 XalanNode* m_node;
268};
269
270
271
272}
273
274
275
276#endif // XALAN_XSLTINPUTSOURCE_HEADER_GUARD
#define XALAN_XSLT_EXPORT
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
void setNode(XalanNode *node)
Set the DOM node for this input source.
XSLTInputSource & operator=(const XSLTInputSource &theRHS)
Assignment operator.
XSLTInputSource(StreamType *stream, MemoryManager &theMemoryManager=XalanMemMgrs::getDefault())
Create a new input source with std stream.
XSLTInputSource(const XalanDOMString &systemId, MemoryManager &theMemoryManager=XalanMemMgrs::getDefault())
Create a new input source with a system identifier.
XSLTInputSource(StreamType &stream, MemoryManager &theMemoryManager=XalanMemMgrs::getDefault())
Create a new input source with std stream.
XalanNode * getNode() const
Retrieve the DOM node for this input source.
virtual BinInputStreamType * makeStream() const
Makes the byte stream for this input source.
XSLTInputSource(MemoryManager &theMemoryManager=XalanMemMgrs::getDefault())
XSLTInputSource(const XMLCh *systemId, MemoryManager &theMemoryManager=XalanMemMgrs::getDefault())
Create a new input source with a system identifier.
StreamType * getStream() const
XSLTInputSource(const char *systemId, const char *publicId, MemoryManager &theMemoryManager=XalanMemMgrs::getDefault())
Create a new input source with a system identifier and a public identifier.
XSLTInputSource(const XSLTInputSource &theSource, MemoryManager &theMemoryManager=XalanMemMgrs::getDefault())
Copy constructor.
XSLTInputSource(XalanNode *node, MemoryManager &theMemoryManager=XalanMemMgrs::getDefault())
Create a new input source with a DOM node.
XSLTInputSource(const XalanDOMString &systemId, const XalanDOMString &publicId, MemoryManager &theMemoryManager=XalanMemMgrs::getDefault())
Create a new input source with a system identifier and a public identifier.
XSLTInputSource(const char *systemId, MemoryManager &theMemoryManager=XalanMemMgrs::getDefault())
Create a new input source with a system identifier.
XSLTInputSource(const XMLCh *systemId, const XMLCh *publicId, MemoryManager &theMemoryManager=XalanMemMgrs::getDefault())
Create a new input source with a system identifier and a public identifier.
void setStream(StreamType *stream)
xercesc::BinInputStream BinInputStreamType
xercesc::InputSource InputSourceType