Xerces-C++ 3.2.0

Wrapper4InputSource.hpp
Go to the documentation of this file.
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18 /*
19 * $Id: Wrapper4InputSource.hpp 932889 2010-04-11 13:10:10Z borisk $
20 */
21
22 #if !defined(XERCESC_INCLUDE_GUARD_WRAPPER4INPUTSOURCE_HPP)
23 #define XERCESC_INCLUDE_GUARD_WRAPPER4INPUTSOURCE_HPP
24
25 #include <xercesc/dom/DOMLSInput.hpp>
26 #include <xercesc/util/PlatformUtils.hpp>
27
28 XERCES_CPP_NAMESPACE_BEGIN
29
30 class InputSource;
31
32
36 class XMLPARSER_EXPORT Wrapper4InputSource: public DOMLSInput
37 {
38 public:
41
53 Wrapper4InputSource(InputSource* const inputSource
54 , const bool adoptFlag = true
55 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
56
61 virtual ~Wrapper4InputSource();
63
64
65 // -----------------------------------------------------------------------
72 virtual const XMLCh* getStringData() const;
73
82 virtual InputSource* getByteStream() const;
84
85 // -----------------------------------------------------------------------
98 virtual const XMLCh* getEncoding() const;
99
100
108 const XMLCh* getPublicId() const;
109
110
120 const XMLCh* getSystemId() const;
121
132 const XMLCh* getBaseURI() const;
133
142 bool getIssueFatalErrorIfNotFound() const;
143
145
146
147 // -----------------------------------------------------------------------
154 virtual void setStringData(const XMLCh* data);
155
160 virtual void setByteStream(InputSource* stream);
161
174 void setEncoding(const XMLCh* const encodingStr);
175
176
189 void setPublicId(const XMLCh* const publicId);
190
206 void setSystemId(const XMLCh* const systemId);
207
218 void setBaseURI(const XMLCh* const baseURI);
219
232 void setIssueFatalErrorIfNotFound(bool flag);
233
240 void release();
241
243
244
245 private:
246 // -----------------------------------------------------------------------
247 // Unimplemented constructors and operators
248 // -----------------------------------------------------------------------
249 Wrapper4InputSource(const Wrapper4InputSource&);
250 Wrapper4InputSource& operator=(const Wrapper4InputSource&);
251
252 // -----------------------------------------------------------------------
253 // Private data members
254 // -----------------------------------------------------------------------
255 bool fAdoptInputSource;
256 InputSource* fInputSource;
257 };
258
259
260 // ---------------------------------------------------------------------------
261 // Wrapper4InputSource: Getter methods
262 // ---------------------------------------------------------------------------
263 inline const XMLCh* Wrapper4InputSource::getBaseURI() const
264 {
265 return 0; // REVISIT - should we return an empty string?
266 }
267
268 inline const XMLCh* Wrapper4InputSource::getStringData() const
269 {
270 return 0;
271 }
272
273 // ---------------------------------------------------------------------------
274 // Wrapper4InputSource: Setter methods
275 // ---------------------------------------------------------------------------
276 inline void Wrapper4InputSource::setBaseURI(const XMLCh* const)
277 {
278 }
279
280 inline void Wrapper4InputSource::setStringData(const XMLCh*)
281 {
282 }
283
284 inline void Wrapper4InputSource::setByteStream(InputSource*)
285 {
286 }
287
288 XERCES_CPP_NAMESPACE_END
289
290 #endif
DOMLSInput::release
virtual void release()=0
Called to indicate that this DOMLSInput is no longer in use and that the implementation may relinquis...
DOMLSInput
This interface represents a single input source for an XML entity.
Definition: DOMLSInput.hpp:59
XMLPlatformUtils::fgMemoryManager
static MemoryManager * fgMemoryManager
The configurable memory manager.
Definition: PlatformUtils.hpp:121
DOMLSInput::setStringData
virtual void setStringData(const XMLCh *data)=0
Sets the UTF-16 string for this input source.
DOMLSInput::setEncoding
virtual void setEncoding(const XMLCh *const encodingStr)=0
Set the encoding which will be required for use with the XML text read via a stream opened by this in...
DOMLSInput::setBaseURI
virtual void setBaseURI(const XMLCh *const baseURI)=0
Set the base URI to be used for resolving relative URIs to absolute URIs.
Wrapper4InputSource::getStringData
virtual const XMLCh * getStringData() const
This wrapper doesn&#39;t support string data.
Definition: Wrapper4InputSource.hpp:268
DOMLSInput::setPublicId
virtual void setPublicId(const XMLCh *const publicId)=0
Set the public identifier for this input source.
Wrapper4InputSource
Wrap a SAX InputSource object and make it behave like DOMLSInput.
Definition: Wrapper4InputSource.hpp:36
XMLPARSER_EXPORT
#define XMLPARSER_EXPORT
Definition: XercesDefs.hpp:163
DOMLSInput::getStringData
virtual const XMLCh * getStringData() const =0
String data to parse.
PlatformUtils.hpp
MemoryManager
Configurable memory manager.
Definition: MemoryManager.hpp:39
DOMLSInput.hpp
DOMLSInput::getEncoding
virtual const XMLCh * getEncoding() const =0
An input source can be set to force the parser to assume a particular encoding for the data that inpu...
Wrapper4InputSource::setByteStream
virtual void setByteStream(InputSource *stream)
This wrapper only exposes the given InputSource, no setting allowed.
Definition: Wrapper4InputSource.hpp:284
DOMLSInput::setByteStream
virtual void setByteStream(InputSource *stream)=0
Sets the byte stream for this input source.
DOMLSInput::getByteStream
virtual InputSource * getByteStream() const =0
Returns the byte stream for this input source.
Wrapper4InputSource::getBaseURI
const XMLCh * getBaseURI() const
Get the base URI to be used for resolving relative URIs to absolute URIs.
Definition: Wrapper4InputSource.hpp:263
XMLCh
uint16_t XMLCh
Definition: Xerces_autoconf_config.hpp:118
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition: XercesDefs.hpp:112
DOMLSInput::setIssueFatalErrorIfNotFound
virtual void setIssueFatalErrorIfNotFound(bool flag)=0
Indicates if the parser should issue fatal error if this input source is not found.
DOMLSInput::getSystemId
virtual const XMLCh * getSystemId() const =0
Get the system identifier for this input source.
DOMLSInput::getIssueFatalErrorIfNotFound
virtual bool getIssueFatalErrorIfNotFound() const =0
Get the flag that indicates if the parser should issue fatal error if this input source is not found...
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition: XercesDefs.hpp:113
Wrapper4InputSource::setStringData
virtual void setStringData(const XMLCh *data)
This wrapper only exposes the given InputSource, no setting allowed.
Definition: Wrapper4InputSource.hpp:280
DOMLSInput::getPublicId
virtual const XMLCh * getPublicId() const =0
Get the public identifier for this input source.
Wrapper4InputSource::setBaseURI
void setBaseURI(const XMLCh *const baseURI)
Set the base URI to be used for resolving relative URIs to absolute URIs.
Definition: Wrapper4InputSource.hpp:276
DOMLSInput::getBaseURI
virtual const XMLCh * getBaseURI() const =0
Get the base URI to be used for resolving relative URIs to absolute URIs.
InputSource
A single input source for an XML entity.
Definition: InputSource.hpp:62
DOMLSInput::setSystemId
virtual void setSystemId(const XMLCh *const systemId)=0
Set the system identifier for this input source.