Xerces-C++ 3.2.4

HandlerBase.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_HANDLERBASE_HPP)
23#define XERCESC_INCLUDE_GUARD_HANDLERBASE_HPP
24
25#include <xercesc/sax/DocumentHandler.hpp>
26#include <xercesc/sax/DTDHandler.hpp>
27#include <xercesc/sax/EntityResolver.hpp>
28#include <xercesc/sax/ErrorHandler.hpp>
29#include <xercesc/sax/SAXParseException.hpp>
30
31 XERCES_CPP_NAMESPACE_BEGIN
32
33 class Locator;
34 class AttributeList;
35
56 class SAX_EXPORT HandlerBase :
57
58 public EntityResolver, public DTDHandler, public DocumentHandler
59 , public ErrorHandler
60{
61 public:
79 virtual void characters
80 (
81 const XMLCh* const chars
82 , const XMLSize_t length
83 );
84
97 virtual void endDocument();
98
112 virtual void endElement(const XMLCh* const name);
113
129 virtual void ignorableWhitespace
130 (
131 const XMLCh* const chars
132 , const XMLSize_t length
133 );
134
150 virtual void processingInstruction
151 (
152 const XMLCh* const target
153 , const XMLCh* const data
154 );
155
161 virtual void resetDocument();
163
178 virtual void setDocumentLocator(const Locator* const locator);
179
192 virtual void startDocument();
193
208 virtual void startElement
209 (
210 const XMLCh* const name
211 , AttributeList& attributes
212 );
213
215
240 virtual InputSource* resolveEntity
241 (
242 const XMLCh* const publicId
243 , const XMLCh* const systemId
244 );
245
247
264 virtual void error(const SAXParseException& exc);
265
283 virtual void fatalError(const SAXParseException& exc);
284
299 virtual void warning(const SAXParseException& exc);
300
306 virtual void resetErrors();
307
309
310
313
327 virtual void notationDecl
328 (
329 const XMLCh* const name
330 , const XMLCh* const publicId
331 , const XMLCh* const systemId
332 );
333
339 virtual void resetDocType();
340
355 virtual void unparsedEntityDecl
356 (
357 const XMLCh* const name
358 , const XMLCh* const publicId
359 , const XMLCh* const systemId
360 , const XMLCh* const notationName
361 );
363
364 HandlerBase() {};
365 virtual ~HandlerBase() {};
366
367 private:
368 // -----------------------------------------------------------------------
369 // Unimplemented constructors and operators
370 // -----------------------------------------------------------------------
371 HandlerBase(const HandlerBase&);
372 HandlerBase& operator=(const HandlerBase&);
373};
374
375
376// ---------------------------------------------------------------------------
377// HandlerBase: Inline default implementations
378// ---------------------------------------------------------------------------
379 inline void HandlerBase::characters(const XMLCh* const
380 , const XMLSize_t)
381{
382}
383
384 inline void HandlerBase::endDocument()
385{
386}
387
388 inline void HandlerBase::endElement(const XMLCh* const)
389{
390}
391
392 inline void HandlerBase::error(const SAXParseException&)
393{
394}
395
396 inline void HandlerBase::fatalError(const SAXParseException& exc)
397{
398 throw exc;
399}
400
401 inline void
402 HandlerBase::ignorableWhitespace( const XMLCh* const
403 , const XMLSize_t)
404{
405}
406
407 inline void HandlerBase::notationDecl( const XMLCh* const
408 , const XMLCh* const
409 , const XMLCh* const)
410{
411}
412
413 inline void
414 HandlerBase::processingInstruction( const XMLCh* const
415 , const XMLCh* const)
416{
417}
418
419 inline void HandlerBase::resetErrors()
420{
421}
422
423 inline void HandlerBase::resetDocument()
424{
425}
426
427 inline void HandlerBase::resetDocType()
428{
429}
430
431 inline InputSource*
432 HandlerBase::resolveEntity( const XMLCh* const
433 , const XMLCh* const)
434{
435 return 0;
436}
437
438 inline void
439 HandlerBase::unparsedEntityDecl(const XMLCh* const
440 , const XMLCh* const
441 , const XMLCh* const
442 , const XMLCh* const)
443{
444}
445
446 inline void HandlerBase::setDocumentLocator(const Locator* const)
447{
448}
449
450 inline void HandlerBase::startDocument()
451{
452}
453
454 inline void
455 HandlerBase::startElement( const XMLCh* const
456 , AttributeList&)
457{
458}
459
460 inline void HandlerBase::warning(const SAXParseException&)
461{
462}
463
464 XERCES_CPP_NAMESPACE_END
465
466#endif
DTDHandler.hpp
DocumentHandler.hpp
EntityResolver.hpp
ErrorHandler.hpp
SAXParseException.hpp
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition: XercesDefs.hpp:112
SAX_EXPORT
#define SAX_EXPORT
Definition: XercesDefs.hpp:164
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition: XercesDefs.hpp:113
XMLCh
uint16_t XMLCh
Definition: Xerces_autoconf_config.hpp:120
XMLSize_t
size_t XMLSize_t
Definition: Xerces_autoconf_config.hpp:112
AttributeList
Interface for an element's attribute specifications.
Definition: AttributeList.hpp:81
DTDHandler
Receive notification of basic DTD-related events.
Definition: DTDHandler.hpp:60
DTDHandler::resetDocType
virtual void resetDocType()=0
Reset the DocType object on its reuse.
DTDHandler::unparsedEntityDecl
virtual void unparsedEntityDecl(const XMLCh *const name, const XMLCh *const publicId, const XMLCh *const systemId, const XMLCh *const notationName)=0
Receive notification of an unparsed entity declaration event.
DTDHandler::notationDecl
virtual void notationDecl(const XMLCh *const name, const XMLCh *const publicId, const XMLCh *const systemId)=0
Receive notification of a notation declaration event.
DocumentHandler
Receive notification of general document events.
Definition: DocumentHandler.hpp:61
DocumentHandler::characters
virtual void characters(const XMLCh *const chars, const XMLSize_t length)=0
Receive notification of character data.
DocumentHandler::startElement
virtual void startElement(const XMLCh *const name, AttributeList &attrs)=0
Receive notification of the beginning of an element.
DocumentHandler::startDocument
virtual void startDocument()=0
Receive notification of the beginning of a document.
DocumentHandler::processingInstruction
virtual void processingInstruction(const XMLCh *const target, const XMLCh *const data)=0
Receive notification of a processing instruction.
DocumentHandler::endDocument
virtual void endDocument()=0
Receive notification of the end of a document.
DocumentHandler::resetDocument
virtual void resetDocument()=0
Reset the Document object on its reuse.
DocumentHandler::endElement
virtual void endElement(const XMLCh *const name)=0
Receive notification of the end of an element.
DocumentHandler::setDocumentLocator
virtual void setDocumentLocator(const Locator *const locator)=0
Receive an object for locating the origin of SAX document events.
DocumentHandler::ignorableWhitespace
virtual void ignorableWhitespace(const XMLCh *const chars, const XMLSize_t length)=0
Receive notification of ignorable whitespace in element content.
EntityResolver
Basic interface for resolving entities.
Definition: EntityResolver.hpp:87
EntityResolver::resolveEntity
virtual InputSource * resolveEntity(const XMLCh *const publicId, const XMLCh *const systemId)=0
Allow the application to resolve external entities.
ErrorHandler
Basic interface for SAX error handlers.
Definition: ErrorHandler.hpp:61
ErrorHandler::warning
virtual void warning(const SAXParseException &exc)=0
Receive notification of a warning.
ErrorHandler::fatalError
virtual void fatalError(const SAXParseException &exc)=0
Receive notification of a non-recoverable error.
ErrorHandler::resetErrors
virtual void resetErrors()=0
Reset the Error handler object on its reuse.
ErrorHandler::error
virtual void error(const SAXParseException &exc)=0
Receive notification of a recoverable error.
HandlerBase
Default base class for handlers.
Definition: HandlerBase.hpp:60
HandlerBase::ignorableWhitespace
virtual void ignorableWhitespace(const XMLCh *const chars, const XMLSize_t length)
Receive notification of ignorable whitespace in element content.
Definition: HandlerBase.hpp:402
HandlerBase::endDocument
virtual void endDocument()
Receive notification of the end of the document.
Definition: HandlerBase.hpp:384
HandlerBase::resetDocType
virtual void resetDocType()
Reset the DTD object on its reuse.
Definition: HandlerBase.hpp:427
HandlerBase::resetDocument
virtual void resetDocument()
Reset the Document object on its reuse.
Definition: HandlerBase.hpp:423
HandlerBase::unparsedEntityDecl
virtual void unparsedEntityDecl(const XMLCh *const name, const XMLCh *const publicId, const XMLCh *const systemId, const XMLCh *const notationName)
Receive notification of an unparsed entity declaration.
Definition: HandlerBase.hpp:439
HandlerBase::~HandlerBase
virtual ~HandlerBase()
Definition: HandlerBase.hpp:365
HandlerBase::startElement
virtual void startElement(const XMLCh *const name, AttributeList &attributes)
Receive notification of the start of an element.
Definition: HandlerBase.hpp:455
HandlerBase::startDocument
virtual void startDocument()
Receive notification of the beginning of the document.
Definition: HandlerBase.hpp:450
HandlerBase::notationDecl
virtual void notationDecl(const XMLCh *const name, const XMLCh *const publicId, const XMLCh *const systemId)
Receive notification of a notation declaration.
Definition: HandlerBase.hpp:407
HandlerBase::characters
virtual void characters(const XMLCh *const chars, const XMLSize_t length)
Receive notification of character data inside an element.
Definition: HandlerBase.hpp:379
HandlerBase::error
virtual void error(const SAXParseException &exc)
Receive notification of a recoverable parser error.
Definition: HandlerBase.hpp:392
HandlerBase::fatalError
virtual void fatalError(const SAXParseException &exc)
Report a fatal XML parsing error.
Definition: HandlerBase.hpp:396
HandlerBase::processingInstruction
virtual void processingInstruction(const XMLCh *const target, const XMLCh *const data)
Receive notification of a processing instruction.
Definition: HandlerBase.hpp:414
HandlerBase::HandlerBase
HandlerBase()
Definition: HandlerBase.hpp:364
HandlerBase::endElement
virtual void endElement(const XMLCh *const name)
Receive notification of the end of an element.
Definition: HandlerBase.hpp:388
HandlerBase::resolveEntity
virtual InputSource * resolveEntity(const XMLCh *const publicId, const XMLCh *const systemId)
Resolve an external entity.
Definition: HandlerBase.hpp:432
HandlerBase::resetErrors
virtual void resetErrors()
Reset the Error handler object on its reuse.
Definition: HandlerBase.hpp:419
HandlerBase::warning
virtual void warning(const SAXParseException &exc)
Receive notification of a parser warning.
Definition: HandlerBase.hpp:460
HandlerBase::setDocumentLocator
virtual void setDocumentLocator(const Locator *const locator)
Receive a Locator object for document events.
Definition: HandlerBase.hpp:446
InputSource
A single input source for an XML entity.
Definition: InputSource.hpp:63
Locator
Interface for associating a SAX event with a document location.
Definition: Locator.hpp:55
SAXParseException
Encapsulate an XML parse error or warning.
Definition: SAXParseException.hpp:49