Xerces-C++ 3.2.5
InputSource.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$
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_INPUTSOURCE_HPP)
23#define XERCESC_INCLUDE_GUARD_INPUTSOURCE_HPP
24
26
28
29class BinInputStream;
30
31
63{
64public:
65 // -----------------------------------------------------------------------
66 // All constructors are hidden, just the destructor is available
67 // -----------------------------------------------------------------------
74 virtual ~InputSource();
76
77
78 // -----------------------------------------------------------------------
91 virtual BinInputStream* makeStream() const = 0;
92
94
95
96 // -----------------------------------------------------------------------
108 virtual const XMLCh* getEncoding() const;
109
110
117 virtual const XMLCh* getPublicId() const;
118
119
128 virtual const XMLCh* getSystemId() const;
129
138 virtual bool getIssueFatalErrorIfNotFound() const;
139
140 MemoryManager* getMemoryManager() const;
141
143
144
145 // -----------------------------------------------------------------------
148
160 virtual void setEncoding(const XMLCh* const encodingStr);
161
162
174 virtual void setPublicId(const XMLCh* const publicId);
175
192 virtual void setSystemId(const XMLCh* const systemId);
193
203 virtual void setIssueFatalErrorIfNotFound(const bool flag);
204
206
207
208protected :
209 // -----------------------------------------------------------------------
210 // Hidden constructors
211 // -----------------------------------------------------------------------
216
222 InputSource(const XMLCh* const systemId,
224
232 (
233 const XMLCh* const systemId
234 , const XMLCh* const publicId
236 );
237
243 InputSource(const char* const systemId,
245
253 (
254 const char* const systemId
255 , const char* const publicId
257 );
258
260
261
262
263
264
265private:
266 // -----------------------------------------------------------------------
267 // Unimplemented constructors and operators
268 // -----------------------------------------------------------------------
269 InputSource(const InputSource&);
270 InputSource& operator=(const InputSource&);
271
272
273 // -----------------------------------------------------------------------
274 // Private data members
275 //
276 // fEncoding
277 // This is the encoding to use. Usually this is null, which means
278 // to use the information found in the file itself. But, if set,
279 // this encoding will be used without question.
280 //
281 // fPublicId
282 // This is the optional public id for the input source. It can be
283 // null if none is desired.
284 //
285 // fSystemId
286 // This is the system id for the input source. This is what is
287 // actually used to open the source.
288 //
289 // fFatalErrorIfNotFound
290 // -----------------------------------------------------------------------
291 MemoryManager* const fMemoryManager;
292 XMLCh* fEncoding;
293 XMLCh* fPublicId;
294 XMLCh* fSystemId;
295 bool fFatalErrorIfNotFound;
296};
297
298
299// ---------------------------------------------------------------------------
300// InputSource: Getter methods
301// ---------------------------------------------------------------------------
302inline const XMLCh* InputSource::getEncoding() const
303{
304 return fEncoding;
305}
306
307inline const XMLCh* InputSource::getPublicId() const
308{
309 return fPublicId;
310}
311
312inline const XMLCh* InputSource::getSystemId() const
313{
314 return fSystemId;
315}
316
318{
319 return fFatalErrorIfNotFound;
320}
321
323{
324 return fMemoryManager;
325}
326
327// ---------------------------------------------------------------------------
328// InputSource: Setter methods
329// ---------------------------------------------------------------------------
331{
332 fFatalErrorIfNotFound = flag;
333}
334
336
337#endif
#define XERCES_CPP_NAMESPACE_BEGIN
Definition XercesDefs.hpp:112
#define SAX_EXPORT
Definition XercesDefs.hpp:164
#define XERCES_CPP_NAMESPACE_END
Definition XercesDefs.hpp:113
uint16_t XMLCh
Definition Xerces_autoconf_config.hpp:120
Definition BinInputStream.hpp:30
A single input source for an XML entity.
Definition InputSource.hpp:63
virtual void setSystemId(const XMLCh *const systemId)
Set the system identifier for this input source.
virtual ~InputSource()
Destructor.
MemoryManager * getMemoryManager() const
Definition InputSource.hpp:322
virtual const XMLCh * getEncoding() const
An input source can be set to force the parser to assume a particular encoding for the data that inpu...
Definition InputSource.hpp:302
virtual void setPublicId(const XMLCh *const publicId)
Set the public identifier for this input source.
InputSource(MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
Default constructor.
InputSource(const XMLCh *const systemId, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
Constructor with a system identifier as XMLCh type.
virtual void setEncoding(const XMLCh *const encodingStr)
Set the encoding which will be required for use with the XML text read via a stream opened by this in...
virtual void setIssueFatalErrorIfNotFound(const bool flag)
Indicates if the parser should issue fatal error if this input source is not found.
Definition InputSource.hpp:330
virtual bool getIssueFatalErrorIfNotFound() const
Get the flag that indicates if the parser should issue fatal error if this input source is not found.
Definition InputSource.hpp:317
InputSource(const char *const systemId, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
Constructor witha system identifier as string.
virtual BinInputStream * makeStream() const =0
Makes the byte stream for this input source.
virtual const XMLCh * getPublicId() const
Get the public identifier for this input source.
Definition InputSource.hpp:307
virtual const XMLCh * getSystemId() const
Get the system identifier for this input source.
Definition InputSource.hpp:312
InputSource(const char *const systemId, const char *const publicId, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
Constructor witha system and public identifiers.
InputSource(const XMLCh *const systemId, const XMLCh *const publicId, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
Constructor with a system and public identifiers.
Configurable memory manager.
Definition MemoryManager.hpp:40
static MemoryManager * fgMemoryManager
The configurable memory manager.
Definition PlatformUtils.hpp:121
This class makes it possible to override the C++ memory management by adding new/delete operators to ...
Definition XMemory.hpp:41