Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACEXML_SAXPrint_Handler Class Reference

ACEXML_SAXPrint_Handler is an example SAX event handler. More...

#include <SAXPrint_Handler.h>

Inheritance diagram for ACEXML_SAXPrint_Handler:

Inheritance graph
[legend]
Collaboration diagram for ACEXML_SAXPrint_Handler:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACEXML_SAXPrint_Handler (const ACEXML_Char *name)
virtual ~ACEXML_SAXPrint_Handler (void)
virtual void characters (const ACEXML_Char *ch, int start, int length ACEXML_ENV_ARG_DECL) ACE_THROW_SPEC((ACEXML_SAXException))
virtual void endDocument (ACEXML_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC((ACEXML_SAXException))
virtual void endElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, const ACEXML_Char *qName ACEXML_ENV_ARG_DECL) ACE_THROW_SPEC((ACEXML_SAXException))
virtual void endPrefixMapping (const ACEXML_Char *prefix ACEXML_ENV_ARG_DECL) ACE_THROW_SPEC((ACEXML_SAXException))
virtual void ignorableWhitespace (const ACEXML_Char *ch, int start, int length ACEXML_ENV_ARG_DECL) ACE_THROW_SPEC((ACEXML_SAXException))
virtual void processingInstruction (const ACEXML_Char *target, const ACEXML_Char *data ACEXML_ENV_ARG_DECL) ACE_THROW_SPEC((ACEXML_SAXException))
virtual void setDocumentLocator (ACEXML_Locator *locator)
virtual void skippedEntity (const ACEXML_Char *name ACEXML_ENV_ARG_DECL) ACE_THROW_SPEC((ACEXML_SAXException))
virtual void startDocument (ACEXML_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC((ACEXML_SAXException))
virtual void startElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, const ACEXML_Char *qName, ACEXML_Attributes *atts ACEXML_ENV_ARG_DECL) ACE_THROW_SPEC((ACEXML_SAXException))
virtual void startPrefixMapping (const ACEXML_Char *prefix, const ACEXML_Char *uri ACEXML_ENV_ARG_DECL) ACE_THROW_SPEC((ACEXML_SAXException))
virtual void notationDecl (const ACEXML_Char *name, const ACEXML_Char *publicId, const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL) ACE_THROW_SPEC((ACEXML_SAXException))
virtual void unparsedEntityDecl (const ACEXML_Char *name, const ACEXML_Char *publicId, const ACEXML_Char *systemId, const ACEXML_Char *notationName ACEXML_ENV_ARG_DECL) ACE_THROW_SPEC((ACEXML_SAXException))
virtual ACEXML_InputSourceresolveEntity (const ACEXML_Char *publicId, const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL) ACE_THROW_SPEC((ACEXML_SAXException))
virtual void error (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) ACE_THROW_SPEC((ACEXML_SAXException))
virtual void fatalError (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) ACE_THROW_SPEC((ACEXML_SAXException))
virtual void warning (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) ACE_THROW_SPEC((ACEXML_SAXException))
void inc_indent ()
void dec_indent ()
void print_indent ()

Private Attributes

size_t indent_
ACEXML_CharfileName_
ACEXML_Locatorlocator_

Detailed Description

ACEXML_SAXPrint_Handler is an example SAX event handler.

This SAX event handler try to regenerate the XML document it reads with correct indentation.

Definition at line 26 of file SAXPrint_Handler.h.


Constructor & Destructor Documentation

ACEXML_SAXPrint_Handler::ACEXML_SAXPrint_Handler const ACEXML_Char   name
 

Definition at line 11 of file SAXPrint_Handler.cpp.

References ACEXML_Char.

00012   : indent_ (0),  fileName_(ACE::strnew (filename)), locator_ (0)
00013 {
00014   // no-op
00015 }

ACEXML_SAXPrint_Handler::~ACEXML_SAXPrint_Handler void    [virtual]
 

Definition at line 17 of file SAXPrint_Handler.cpp.

References fileName_.

00018 {
00019   delete [] this->fileName_;
00020 }


Member Function Documentation

virtual void ACEXML_SAXPrint_Handler::characters const ACEXML_Char   ch,
int    start,
int length    ACEXML_ENV_ARG_DECL
[virtual]
 

Receive notification of character data.

Reimplemented from ACEXML_DefaultHandler.

ACEXML_INLINE void ACEXML_SAXPrint_Handler::dec_indent  
 

Definition at line 10 of file SAXPrint_Handler.i.

References indent_.

00011 {
00012   this->indent_ -= 1;
00013 }

void ACEXML_SAXPrint_Handler::endDocument ACEXML_ENV_SINGLE_ARG_DECL    [virtual]
 

Receive notification of the end of a document.

Reimplemented from ACEXML_DefaultHandler.

Definition at line 37 of file SAXPrint_Handler.cpp.

References ACE_DEBUG, ACE_TEXT, ACEXML_ENV_SINGLE_ARG_DECL_NOT_USED, and LM_DEBUG.

00039 {
00040 
00041 
00042   ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n")));
00043 }

void ACEXML_SAXPrint_Handler::endElement const ACEXML_Char   namespaceURI,
const ACEXML_Char   localName,
const ACEXML_Char *qName    ACEXML_ENV_ARG_DECL
[virtual]
 

Receive notification of the end of an element.

Reimplemented from ACEXML_DefaultHandler.

Definition at line 46 of file SAXPrint_Handler.cpp.

References ACE_DEBUG, ACE_TEXT, ACEXML_Char, ACEXML_ENV_ARG_DECL_NOT_USED, and LM_DEBUG.

00051 {
00052 
00053 
00054   this->dec_indent ();
00055   this->print_indent ();
00056   ACE_DEBUG ((LM_DEBUG,
00057               ACE_TEXT ("</%s>"),
00058               qName));
00059 }

void ACEXML_SAXPrint_Handler::endPrefixMapping const ACEXML_Char *prefix    ACEXML_ENV_ARG_DECL [virtual]
 

End the scope of a prefix-URI mapping.

Reimplemented from ACEXML_DefaultHandler.

Definition at line 62 of file SAXPrint_Handler.cpp.

References ACE_DEBUG, ACE_TEXT, ACEXML_Char, ACEXML_ENV_ARG_DECL_NOT_USED, and LM_DEBUG.

00065 {
00066 
00067 
00068   ACE_DEBUG ((LM_DEBUG,
00069               ACE_TEXT ("* Event endPrefixMapping (%s) ***************\n"),
00070               prefix));
00071 }

virtual void ACEXML_SAXPrint_Handler::error ACEXML_SAXParseException &exception    ACEXML_ENV_ARG_DECL [virtual]
 

Receive notification of a recoverable error.

Reimplemented from ACEXML_DefaultHandler.

virtual void ACEXML_SAXPrint_Handler::fatalError ACEXML_SAXParseException &exception    ACEXML_ENV_ARG_DECL [virtual]
 

Receive notification of a non-recoverable error.

Reimplemented from ACEXML_DefaultHandler.

void ACEXML_SAXPrint_Handler::ignorableWhitespace const ACEXML_Char   ch,
int    start,
int length    ACEXML_ENV_ARG_DECL
[virtual]
 

Receive notification of ignorable whitespace in element content.

Reimplemented from ACEXML_DefaultHandler.

Definition at line 74 of file SAXPrint_Handler.cpp.

References ACE_DEBUG, ACE_TEXT, ACEXML_Char, ACEXML_ENV_ARG_DECL_NOT_USED, and LM_DEBUG.

00078 {
00079 
00080 
00081   ACE_DEBUG ((LM_DEBUG,
00082               ACE_TEXT ("* Event ignorableWhitespace () ***************\n")));
00083 }

ACEXML_INLINE void ACEXML_SAXPrint_Handler::inc_indent  
 

Definition at line 4 of file SAXPrint_Handler.i.

References indent_.

00005 {
00006   this->indent_ += 1;
00007 }

virtual void ACEXML_SAXPrint_Handler::notationDecl const ACEXML_Char   name,
const ACEXML_Char   publicId,
const ACEXML_Char *systemId    ACEXML_ENV_ARG_DECL
[virtual]
 

Receive notification of a notation declaration event.

Reimplemented from ACEXML_DefaultHandler.

void ACEXML_SAXPrint_Handler::print_indent  
 

Definition at line 238 of file SAXPrint_Handler.cpp.

References ACE_DEBUG, ACE_TEXT, indent_, and LM_DEBUG.

00239 {
00240   ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n")));
00241   for (size_t i = 0; i < this->indent_; ++i)
00242     ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("  ")));
00243 }

void ACEXML_SAXPrint_Handler::processingInstruction const ACEXML_Char   target,
const ACEXML_Char *data    ACEXML_ENV_ARG_DECL
[virtual]
 

Receive notification of a processing instruction.

Reimplemented from ACEXML_DefaultHandler.

Definition at line 86 of file SAXPrint_Handler.cpp.

References ACE_DEBUG, ACE_TEXT, ACEXML_Char, ACEXML_ENV_ARG_DECL_NOT_USED, and LM_DEBUG.

00090 {
00091 
00092 
00093   this->print_indent ();
00094   ACE_DEBUG ((LM_DEBUG,
00095               ACE_TEXT ("<?%s %s>\n"),
00096               target, data));
00097 }

virtual ACEXML_InputSource* ACEXML_SAXPrint_Handler::resolveEntity const ACEXML_Char   publicId,
const ACEXML_Char *systemId    ACEXML_ENV_ARG_DECL
[virtual]
 

Allow the application to resolve external entities.

Reimplemented from ACEXML_DefaultHandler.

void ACEXML_SAXPrint_Handler::setDocumentLocator ACEXML_Locator   locator [virtual]
 

Receive an object for locating the origin of SAX document events.

Reimplemented from ACEXML_DefaultHandler.

Definition at line 100 of file SAXPrint_Handler.cpp.

References ACE_DEBUG, ACE_TEXT, LM_DEBUG, and locator_.

00101 {
00102 
00103   this->locator_ = locator;
00104   ACE_DEBUG ((LM_DEBUG,
00105               ACE_TEXT ("* Event setDocumentLocator () ***************\n")));
00106 }

void ACEXML_SAXPrint_Handler::skippedEntity const ACEXML_Char *name    ACEXML_ENV_ARG_DECL [virtual]
 

Receive notification of a skipped entity.

Reimplemented from ACEXML_DefaultHandler.

Definition at line 109 of file SAXPrint_Handler.cpp.

References ACE_DEBUG, ACE_TEXT, ACEXML_Char, ACEXML_ENV_ARG_DECL_NOT_USED, and LM_DEBUG.

00112 {
00113 
00114 
00115   ACE_DEBUG ((LM_DEBUG,
00116               ACE_TEXT ("* Event skippedEntity (%s) ***************\n"),
00117               name));
00118 }

void ACEXML_SAXPrint_Handler::startDocument ACEXML_ENV_SINGLE_ARG_DECL    [virtual]
 

Receive notification of the beginning of a document.

Reimplemented from ACEXML_DefaultHandler.

Definition at line 121 of file SAXPrint_Handler.cpp.

References ACE_DEBUG, ACE_TEXT, ACEXML_ENV_SINGLE_ARG_DECL_NOT_USED, and LM_DEBUG.

00123 {
00124 
00125 
00126   ACE_DEBUG ((LM_DEBUG,
00127               ACE_TEXT ("* Event startDocument () ***************\n")));
00128 }

virtual void ACEXML_SAXPrint_Handler::startElement const ACEXML_Char   namespaceURI,
const ACEXML_Char   localName,
const ACEXML_Char   qName,
ACEXML_Attributes *atts    ACEXML_ENV_ARG_DECL
[virtual]
 

Receive notification of the beginning of an element.

Reimplemented from ACEXML_DefaultHandler.

void ACEXML_SAXPrint_Handler::startPrefixMapping const ACEXML_Char   prefix,
const ACEXML_Char *uri    ACEXML_ENV_ARG_DECL
[virtual]
 

Begin the scope of a prefix-URI Namespace mapping.

Reimplemented from ACEXML_DefaultHandler.

Definition at line 156 of file SAXPrint_Handler.cpp.

References ACE_DEBUG, ACE_TEXT, ACEXML_Char, ACEXML_ENV_ARG_DECL_NOT_USED, and LM_DEBUG.

00159 {
00160   ACE_DEBUG ((LM_DEBUG,
00161               ACE_TEXT ("* Event startPrefixMapping () ***************\n")));
00162   ACE_DEBUG ((LM_DEBUG,
00163               ACE_TEXT ("Prefix = %s, URI = %s\n"), prefix, uri));
00164 
00165 }

virtual void ACEXML_SAXPrint_Handler::unparsedEntityDecl const ACEXML_Char   name,
const ACEXML_Char   publicId,
const ACEXML_Char   systemId,
const ACEXML_Char *notationName    ACEXML_ENV_ARG_DECL
[virtual]
 

Receive notification of an unparsed entity declaration event.

Reimplemented from ACEXML_DefaultHandler.

virtual void ACEXML_SAXPrint_Handler::warning ACEXML_SAXParseException &exception    ACEXML_ENV_ARG_DECL [virtual]
 

Receive notification of a warning.

Reimplemented from ACEXML_DefaultHandler.


Member Data Documentation

ACEXML_Char* ACEXML_SAXPrint_Handler::fileName_ [private]
 

Definition at line 188 of file SAXPrint_Handler.h.

Referenced by ~ACEXML_SAXPrint_Handler.

size_t ACEXML_SAXPrint_Handler::indent_ [private]
 

Definition at line 187 of file SAXPrint_Handler.h.

Referenced by dec_indent, inc_indent, and print_indent.

ACEXML_Locator* ACEXML_SAXPrint_Handler::locator_ [private]
 

Definition at line 189 of file SAXPrint_Handler.h.

Referenced by setDocumentLocator.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 13:27:29 2003 for ACEXML by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002