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

Print_Handler.cpp

Go to the documentation of this file.
00001 // -*- C++ -*-  $Id: Print_Handler.cpp,v 1.1.1.1 2003/02/21 18:36:32 chad Exp $
00002 
00003 #include "Print_Handler.h"
00004 #include "ace/ACE.h"
00005 #include "ace/Log_Msg.h"
00006 
00007 #if !defined (__ACEXML_INLINE__)
00008 # include "Print_Handler.i"
00009 #endif /* __ACEXML_INLINE__ */
00010 
00011 ACEXML_Print_Handler::ACEXML_Print_Handler (ACEXML_Char* fileName)
00012   : fileName_(ACE::strnew (fileName))
00013 {
00014 
00015 }
00016 
00017 ACEXML_Print_Handler::~ACEXML_Print_Handler (void)
00018 {
00019   delete[] this->fileName_;
00020 }
00021 
00022 void
00023 ACEXML_Print_Handler::characters (const ACEXML_Char *cdata,
00024                                   int start,
00025                                   int end ACEXML_ENV_ARG_DECL_NOT_USED)
00026       ACE_THROW_SPEC ((ACEXML_SAXException))
00027 {
00028 
00029 
00030   ACE_DEBUG ((LM_DEBUG,
00031               ACE_TEXT ("* Event characters () ** start: %d  end: %d ***************\n%s\n- End event characters () ---------------\n"),
00032               start, end, cdata));
00033 }
00034 
00035 void
00036 ACEXML_Print_Handler::endDocument (ACEXML_ENV_SINGLE_ARG_DECL_NOT_USED)
00037       ACE_THROW_SPEC ((ACEXML_SAXException))
00038 {
00039 
00040 
00041   ACE_DEBUG ((LM_DEBUG,
00042               ACE_TEXT ("* Event endDocument () ***************\n")));
00043 }
00044 
00045 void
00046 ACEXML_Print_Handler::endElement (const ACEXML_Char *uri,
00047                                   const ACEXML_Char *name,
00048                                   const ACEXML_Char *qName
00049                                   ACEXML_ENV_ARG_DECL_NOT_USED)
00050       ACE_THROW_SPEC ((ACEXML_SAXException))
00051 {
00052 
00053 
00054   ACE_DEBUG ((LM_DEBUG,
00055               ACE_TEXT ("* Event endElement (%s, %s, %s) ***************\n"),
00056               uri, name, qName));
00057 }
00058 
00059 void
00060 ACEXML_Print_Handler::endPrefixMapping (const ACEXML_Char *prefix
00061                                         ACEXML_ENV_ARG_DECL_NOT_USED)
00062       ACE_THROW_SPEC ((ACEXML_SAXException))
00063 {
00064 
00065 
00066   ACE_DEBUG ((LM_DEBUG,
00067               ACE_TEXT ("* Event endPrefixMapping (%s) ***************\n"),
00068               prefix));
00069 }
00070 
00071 void
00072 ACEXML_Print_Handler::ignorableWhitespace (const ACEXML_Char *,
00073                                            int,
00074                                            int
00075                                            ACEXML_ENV_ARG_DECL_NOT_USED)
00076       ACE_THROW_SPEC ((ACEXML_SAXException))
00077 {
00078 
00079 
00080   ACE_DEBUG ((LM_DEBUG,
00081               ACE_TEXT ("* Event ignorableWhitespace () ***************\n")));
00082 }
00083 
00084 void
00085 ACEXML_Print_Handler::processingInstruction (const ACEXML_Char *target,
00086                                              const ACEXML_Char *data
00087                                              ACEXML_ENV_ARG_DECL_NOT_USED)
00088       ACE_THROW_SPEC ((ACEXML_SAXException))
00089 {
00090 
00091 
00092   ACE_DEBUG ((LM_DEBUG,
00093               ACE_TEXT ("* Event processingInstruction (%s, %s) ***************\n"),
00094               target, data));
00095 }
00096 
00097 void
00098 ACEXML_Print_Handler::setDocumentLocator (ACEXML_Locator * locator)
00099 {
00100 
00101   this->locator_ = locator;
00102   ACE_DEBUG ((LM_DEBUG,
00103               ACE_TEXT ("* Event setDocumentLocator () ***************\n")));
00104 }
00105 
00106 void
00107 ACEXML_Print_Handler::skippedEntity (const ACEXML_Char *name
00108                                      ACEXML_ENV_ARG_DECL_NOT_USED)
00109       ACE_THROW_SPEC ((ACEXML_SAXException))
00110 {
00111 
00112 
00113   ACE_DEBUG ((LM_DEBUG,
00114               ACE_TEXT ("* Event skippedEntity (%s) ***************\n"),
00115               name));
00116 }
00117 
00118 void
00119 ACEXML_Print_Handler::startDocument (ACEXML_ENV_SINGLE_ARG_DECL_NOT_USED)
00120       ACE_THROW_SPEC ((ACEXML_SAXException))
00121 {
00122 
00123 
00124   ACE_DEBUG ((LM_DEBUG,
00125               ACE_TEXT ("* Event startDocument () ***************\n")));
00126 }
00127 
00128 void
00129 ACEXML_Print_Handler::startElement (const ACEXML_Char *uri,
00130                                     const ACEXML_Char *name,
00131                                     const ACEXML_Char *qName,
00132                                     ACEXML_Attributes *alist
00133                                     ACEXML_ENV_ARG_DECL_NOT_USED)
00134       ACE_THROW_SPEC ((ACEXML_SAXException))
00135 {
00136 
00137 
00138   ACE_DEBUG ((LM_DEBUG,
00139               ACE_TEXT ("* Event startElement (%s, %s, %s) ***************\n"),
00140               uri, name, qName));
00141 
00142   if (alist != 0)
00143     for (size_t i = 0; i < alist->getLength (); ++i)
00144       {
00145         ACE_DEBUG ((LM_DEBUG,
00146                     ACE_TEXT ("    %s = \"%s\"\n"),
00147                     alist->getQName (i), alist->getValue (i)));
00148       }
00149 }
00150 
00151 void
00152 ACEXML_Print_Handler::startPrefixMapping (const ACEXML_Char * prefix,
00153                                           const ACEXML_Char * uri ACEXML_ENV_ARG_DECL_NOT_USED)
00154       ACE_THROW_SPEC ((ACEXML_SAXException))
00155 {
00156   ACE_DEBUG ((LM_DEBUG,
00157               ACE_TEXT ("* Event startPrefixMapping () ***************\n")));
00158   ACE_DEBUG ((LM_DEBUG,
00159               ACE_TEXT ("Prefix = %s, URI = %s\n"), prefix, uri));
00160 }
00161 
00162 // *** Methods inherit from ACEXML_DTDHandler.
00163 
00164 void
00165 ACEXML_Print_Handler::notationDecl (const ACEXML_Char *name,
00166                                     const ACEXML_Char *publicID,
00167                                     const ACEXML_Char *systemID ACEXML_ENV_ARG_DECL_NOT_USED)
00168       ACE_THROW_SPEC ((ACEXML_SAXException))
00169 {
00170   ACE_DEBUG ((LM_DEBUG,
00171               ACE_TEXT ("* Event notationDecl: (%s) "),
00172               name));
00173 
00174   if (publicID == 0)
00175     ACE_DEBUG ((LM_DEBUG,
00176                 ACE_TEXT ("SYSTEM %s\n"),
00177                 systemID));
00178   else if (systemID == 0)
00179     ACE_DEBUG ((LM_DEBUG,
00180                 ACE_TEXT ("PUBLIC %s\n"),
00181                 publicID));
00182   else
00183     ACE_DEBUG ((LM_DEBUG,
00184                 ACE_TEXT ("PUBLIC %s %s\n"),
00185                 publicID, systemID));
00186 }
00187 
00188 void
00189 ACEXML_Print_Handler::unparsedEntityDecl (const ACEXML_Char *name,
00190                                           const ACEXML_Char *publicID,
00191                                           const ACEXML_Char *systemID,
00192                                           const ACEXML_Char *notationName ACEXML_ENV_ARG_DECL_NOT_USED)
00193       ACE_THROW_SPEC ((ACEXML_SAXException))
00194 {
00195   ACE_DEBUG ((LM_DEBUG,
00196               ACE_TEXT ("* Unparsed Entity: %s"),
00197               name));
00198 
00199   if (publicID == 0)
00200     ACE_DEBUG ((LM_DEBUG,
00201                 ACE_TEXT (" SYSTEM %s"),
00202                 systemID));
00203   else
00204     ACE_DEBUG ((LM_DEBUG,
00205                 ACE_TEXT (" PUBLIC %s %s"),
00206                 publicID, systemID));
00207 
00208   ACE_DEBUG ((LM_DEBUG,
00209               ACE_TEXT (" NDATA %s\n"),
00210               notationName));
00211 }
00212 
00213 // Methods inherit from ACEXML_EnitityResolver.
00214 
00215 ACEXML_InputSource *
00216 ACEXML_Print_Handler::resolveEntity (const ACEXML_Char *,
00217                                      const ACEXML_Char * ACEXML_ENV_ARG_DECL_NOT_USED)
00218       ACE_THROW_SPEC ((ACEXML_SAXException))
00219 {
00220   // No-op.
00221   return 0;
00222 }
00223 
00224 // Methods inherit from ACEXML_ErrorHandler.
00225 
00226   /*
00227    * Receive notification of a recoverable error.
00228    */
00229 void
00230 ACEXML_Print_Handler::error (ACEXML_SAXParseException & ex ACEXML_ENV_ARG_DECL_NOT_USED)
00231       ACE_THROW_SPEC ((ACEXML_SAXException))
00232 {
00233 
00234   ACE_DEBUG ((LM_DEBUG, "%s:%d:%d ", this->fileName_,
00235               this->locator_->getLineNumber(),
00236               this->locator_->getColumnNumber()));
00237   ex.print();
00238 }
00239 
00240 void
00241 ACEXML_Print_Handler::fatalError (ACEXML_SAXParseException& ex ACEXML_ENV_ARG_DECL_NOT_USED)
00242       ACE_THROW_SPEC ((ACEXML_SAXException))
00243 {
00244 
00245   ACE_DEBUG ((LM_DEBUG, "%s:%d:%d ", this->fileName_,
00246               this->locator_->getLineNumber(),
00247               this->locator_->getColumnNumber()));
00248   ex.print();
00249 }
00250 
00251 void
00252 ACEXML_Print_Handler::warning (ACEXML_SAXParseException & ACEXML_ENV_ARG_DECL_NOT_USED)
00253       ACE_THROW_SPEC ((ACEXML_SAXException))
00254 {
00255   // No-op.
00256 }

Generated on Mon Jun 16 13:23:25 2003 for ACEXML by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002