Public Member Functions | Private Attributes

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 Member Functions

 ACEXML_SAXPrint_Handler (const ACEXML_Char *name)
virtual ~ACEXML_SAXPrint_Handler (void)
virtual void characters (const ACEXML_Char *ch, size_t start, size_t length ACEXML_ENV_ARG_DECL)
virtual void endDocument (ACEXML_ENV_SINGLE_ARG_DECL)
virtual void endElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, const ACEXML_Char *qName ACEXML_ENV_ARG_DECL)
virtual void endPrefixMapping (const ACEXML_Char *prefix ACEXML_ENV_ARG_DECL)
virtual void ignorableWhitespace (const ACEXML_Char *ch, int start, int length ACEXML_ENV_ARG_DECL)
virtual void processingInstruction (const ACEXML_Char *target, const ACEXML_Char *data ACEXML_ENV_ARG_DECL)
virtual void setDocumentLocator (ACEXML_Locator *locator)
virtual void skippedEntity (const ACEXML_Char *name ACEXML_ENV_ARG_DECL)
virtual void startDocument (ACEXML_ENV_SINGLE_ARG_DECL)
virtual void startElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, const ACEXML_Char *qName, ACEXML_Attributes *atts ACEXML_ENV_ARG_DECL)
virtual void startPrefixMapping (const ACEXML_Char *prefix, const ACEXML_Char *uri ACEXML_ENV_ARG_DECL)
virtual void notationDecl (const ACEXML_Char *name, const ACEXML_Char *publicId, const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL)
virtual void unparsedEntityDecl (const ACEXML_Char *name, const ACEXML_Char *publicId, const ACEXML_Char *systemId, const ACEXML_Char *notationName ACEXML_ENV_ARG_DECL)
virtual ACEXML_InputSourceresolveEntity (const ACEXML_Char *publicId, const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL)
virtual void error (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL)
virtual void fatalError (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL)
virtual void warning (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL)
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.

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

ACEXML_SAXPrint_Handler::~ACEXML_SAXPrint_Handler ( void   )  [virtual]

Definition at line 17 of file SAXPrint_Handler.cpp.

{
  delete [] this->fileName_;
}


Member Function Documentation

virtual void ACEXML_SAXPrint_Handler::characters ( const ACEXML_Char ch,
size_t  start,
size_t length  ACEXML_ENV_ARG_DECL 
) [virtual]

Reimplemented from ACEXML_DefaultHandler.

ACEXML_INLINE void ACEXML_SAXPrint_Handler::dec_indent ( void   ) 

Definition at line 10 of file SAXPrint_Handler.inl.

{
  this->indent_ -= 1;
}

virtual void ACEXML_SAXPrint_Handler::endDocument ( ACEXML_ENV_SINGLE_ARG_DECL   )  [virtual]

Reimplemented from ACEXML_DefaultHandler.

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

Reimplemented from ACEXML_DefaultHandler.

Definition at line 42 of file SAXPrint_Handler.cpp.

{


  this->dec_indent ();
  this->print_indent ();
  ACE_DEBUG ((LM_DEBUG,
              ACE_TEXT ("</%s>"),
              qName));
}

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

Reimplemented from ACEXML_DefaultHandler.

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.

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

Reimplemented from ACEXML_DefaultHandler.

ACEXML_INLINE void ACEXML_SAXPrint_Handler::inc_indent ( void   ) 

Definition at line 4 of file SAXPrint_Handler.inl.

{
  this->indent_ += 1;
}

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

Reimplemented from ACEXML_DefaultHandler.

void ACEXML_SAXPrint_Handler::print_indent ( void   ) 

Definition at line 221 of file SAXPrint_Handler.cpp.

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

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

Reimplemented from ACEXML_DefaultHandler.

Definition at line 78 of file SAXPrint_Handler.cpp.

{


  this->print_indent ();
  ACE_DEBUG ((LM_DEBUG,
              ACE_TEXT ("<?%s %s>\n"),
              target, data));
}

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

Reimplemented from ACEXML_DefaultHandler.

void ACEXML_SAXPrint_Handler::setDocumentLocator ( ACEXML_Locator locator  )  [virtual]

Reimplemented from ACEXML_DefaultHandler.

Definition at line 91 of file SAXPrint_Handler.cpp.

{

  this->locator_ = locator;
  //ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("* Event setDocumentLocator () ***************\n")));
}

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

Reimplemented from ACEXML_DefaultHandler.

Definition at line 99 of file SAXPrint_Handler.cpp.

{


  ACE_DEBUG ((LM_DEBUG,
              ACE_TEXT ("* Event skippedEntity (%s) ***************\n"),
              name));
}

virtual void ACEXML_SAXPrint_Handler::startDocument ( ACEXML_ENV_SINGLE_ARG_DECL   )  [virtual]

Reimplemented from ACEXML_DefaultHandler.

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]

Reimplemented from ACEXML_DefaultHandler.

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

Reimplemented from ACEXML_DefaultHandler.

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]

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

Definition at line 173 of file SAXPrint_Handler.h.

Definition at line 172 of file SAXPrint_Handler.h.

Definition at line 174 of file SAXPrint_Handler.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines