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 
41 namespace XERCES_CPP_NAMESPACE
42 {
43  class Locator;
44 }
45 
46 
47 
48 namespace XALAN_CPP_NAMESPACE {
49 
50 
51 
52 typedef xercesc::BinInputStream BinInputStreamType;
53 typedef xercesc::InputSource InputSourceType;
54 using xercesc::MemoryManager;
55 
56 
57 class XalanDOMString;
58 class XalanNode;
59 
60 
61 
63 {
64 public:
65 
66  typedef std::istream StreamType;
67 
68  explicit
69  XSLTInputSource(MemoryManager& theMemoryManager = XalanMemMgrs::getDefault());
70 
71  /**
72  * Copy constructor.
73  */
75  const XSLTInputSource& theSource,
76  MemoryManager& theMemoryManager = XalanMemMgrs::getDefault());
77 
78  /**
79  * Assignment operator.
80  */
82  operator=(const XSLTInputSource& theRHS);
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  */
111  const XalanDOMString& systemId,
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  */
170  const XalanDOMString& systemId,
171  const XalanDOMString& publicId,
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  */
199  StreamType* stream,
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  */
213  StreamType& stream,
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 
263 private:
264 
265  StreamType* m_stream;
266 
267  XalanNode* m_node;
268 };
269 
270 
271 
272 }
273 
274 
275 
276 #endif // XALAN_XSLTINPUTSOURCE_HEADER_GUARD
XALAN_CPP_NAMESPACE
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
Definition: XalanVersion.hpp:76
xalanc::XalanNode
Definition: XalanNode.hpp:38
xalanc::XSLTInputSource::getNode
XalanNode * getNode() const
Retrieve the DOM node for this input source.
Definition: XSLTInputSource.hpp:246
XALAN_XSLT_EXPORT
#define XALAN_XSLT_EXPORT
Definition: XSLTDefinitions.hpp:27
xalanc::XSLTInputSource::setNode
void setNode(XalanNode *node)
Set the DOM node for this input source.
Definition: XSLTInputSource.hpp:235
xalanc::XSLTInputSource::getStream
StreamType * getStream() const
Definition: XSLTInputSource.hpp:252
XalanMemoryManagement.hpp
xalanc::XSLTInputSource
Definition: XSLTInputSource.hpp:62
xalanc::XSLTInputSource::setStream
void setStream(StreamType *stream)
Definition: XSLTInputSource.hpp:258
xalanc::BinInputStreamType
xercesc::BinInputStream BinInputStreamType
Definition: XSLTInputSource.hpp:52
xalanc::InputSourceType
xercesc::InputSource InputSourceType
Definition: XMLParserLiaison.hpp:50
XSLTDefinitions.hpp
xalanc::XSLTInputSource::StreamType
std::istream StreamType
Definition: XSLTInputSource.hpp:66
xalanc::XalanDOMString
Definition: XalanDOMString.hpp:45