Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

DefaultHandler.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------*
00002  | Library QgarLib, graphics analysis and recognition                  |
00003  | Copyright (C) 2003  Qgar Project, LORIA                             |
00004  |                                                                     |
00005  | This library is free software; you can redistribute it and/or       |
00006  | modify it under the terms of the GNU Lesser General Public          |
00007  | License version 2.1, as published by the Free Software Foundation.  |
00008  |                                                                     |
00009  | This library is distributed in the hope that it will be useful,     |
00010  | but WITHOUT ANY WARRANTY; without even the implied warranty of      |
00011  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                |
00012  | See the GNU Lesser General Public License for more details.         |
00013  |                                                                     |
00014  | The GNU Lesser General Public License is included in the file       |
00015  | LICENSE.LGPL, in the root directory of the Qgar packaging. See      |
00016  | http://www.gnu.org/licenses/lgpl.html for the terms of the license. |
00017  | To receive a paper copy, write to the Free Software Foundation,     |
00018  | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.       |
00019  |                                                                     |
00020  | Contact Project Qgar for any information:                           |
00021  |   LORIA - équipe Qgar                                               |
00022  |   B.P. 239, 54506 Vandoeuvre-lès-Nancy Cedex, France                |
00023  |   email: qgar-contact@loria.fr                                      |
00024  |   http://www.qgar.org/                                              |
00025  *---------------------------------------------------------------------*/      
00026 #ifndef __DEFAULTHANDLER_H_INCLUDED__
00027 #define __DEFAULTHANDLER_H_INCLUDED__
00028 
00029 
00030 /**
00031  * @file     DefaultHandler.H
00032  * @brief    Header file of class qgxml::DefaultHandler
00033  *
00034  * @author   <a href="mailto:qgar-contact@loria.fr?subject=Qgar fwd Jan Rendek">Jan Rendek</a>
00035  * @date     March 3, 2003  17:47
00036  * @since    Qgar 2.1.1
00037  */
00038 
00039 
00040 // For RCS/CVS use: Do not delete
00041 /* $Id: DefaultHandler.H,v 1.5 2004/07/02 20:36:43 masini Exp $ */
00042 
00043 #include <qgarlib/sax/ContentHandler.H>
00044 #include <qgarlib/sax/DTDHandler.H>
00045 #include <qgarlib/sax/EntityResolver.H>
00046 #include <qgarlib/sax/ErrorHandler.H>
00047                                
00048 namespace qgxml {
00049 
00050 
00051 /**
00052  * @class DefaultHandler DefaultHandler.H <qgarlib/sax/DefaultHandler.H>
00053  * @ingroup XML
00054  * @brief Default base class for SAX2 event handlers.
00055  * 
00056  * This class is available as a convenience base class for SAX2
00057  * applications: it provides default implementations for all of the
00058  * callbacks in the four core SAX2 handler classes:
00059  * - EntityResolver
00060  * - DTDHandler
00061  * - ContentHandler
00062  * - ErrorHandler
00063  * 
00064  * @see ContentHandler
00065  * @see DTDHandler
00066  * @see EntityResolver
00067  * @see ErrorHandler
00068  *
00069  * @author <a href="mailto:qgar-contact@loria.fr?subject=Qgar fwd Jan Rendek">Jan Rendek</a>
00070  * @date   March 3, 2003  17:47
00071  * @since  Qgar 2.1.1
00072  */
00073 class DefaultHandler : public ContentHandler,
00074                        public DTDHandler, 
00075                        public EntityResolver, 
00076                        public ErrorHandler
00077 {
00078 
00079 // -------------------------------------------------------------------
00080 // P U B L I C    M E M B E R S
00081 // -------------------------------------------------------------------
00082 public:
00083 
00084   // --------------------------------------
00085   // USING DEFAULT CONSTRUCTOR & DESTRUCTOR
00086   // --------------------------------------
00087 
00088 
00089 /** @name ContentHandler Impl */
00090 //        ===================
00091 //@{
00092 
00093   virtual void characters(const char * ch, 
00094                           const unsigned int start, 
00095                           const unsigned int length)
00096   { /* EMPTY */ }
00097   
00098 
00099   virtual void endDocument()
00100   { /* EMPTY */ }
00101   
00102 
00103   virtual void endElement(const std::string& uri,
00104                           const std::string& localName, 
00105                           const std::string& qName)
00106   { /* EMPTY */ }
00107   
00108   
00109   virtual void endPrefixMapping(const std::string& prefix)
00110   { /* EMPTY */ }
00111   
00112   
00113   virtual void ignorableWhitespace(const char * ch, 
00114                                    const unsigned int start, 
00115                                    const unsigned int length)
00116   { /* EMPTY */ }
00117   
00118 
00119   virtual void processingInstruction(const std::string& target, 
00120                                      const std::string& data)
00121   { /* EMPTY */ }
00122 
00123   
00124   virtual void setDocumentLocator(Locator * locator)
00125   { /* EMPTY */ }
00126   
00127 
00128   virtual void skippedEntity(const std::string& name)
00129   { /* EMPTY */ }
00130   
00131 
00132   virtual void startDocument()
00133   { /* EMPTY */ }
00134 
00135 
00136   virtual void startElement(const std::string& uri,
00137                             const std::string& localName,
00138                             const std::string& qName,
00139                             const Attributes& atts)
00140   { /* EMPTY */ }
00141   
00142 
00143   virtual void startPrefixMapping(const std::string& prefix, 
00144                                   const std::string& uri)
00145   { /* EMPTY */ }
00146 
00147 
00148 //@}
00149 
00150 /** @name DTDHandler Impl */
00151 //        ===============
00152 //@{
00153 
00154   virtual void notationDecl(const std::string& name, 
00155                             const std::string& publicId, 
00156                             const std::string& systemId)
00157   { /* EMPTY */ }
00158   
00159 
00160   virtual void unparsedEntityDecl(const std::string& name,
00161                                   const std::string& publicId, 
00162                                   const std::string& systemId,
00163                                   const std::string& notationName)
00164   { /* EMPTY */ }
00165 
00166 //@}
00167 
00168 /** @name EntityResolver Impl */
00169 //        ===================
00170 //@{
00171 
00172   virtual InputSource * resolveEntity(const std::string& publicId,
00173                                       const std::string& systemId)
00174   { return 0; }
00175 
00176 //@}
00177 
00178 /** @name ErrorHandler Impl */
00179 //        =================
00180 //@{
00181 
00182   virtual void error(const SAXParseException& exception)
00183   { /* EMPTY */ }
00184   
00185  
00186   virtual void fatalError(const SAXParseException& exception)
00187   { /* EMPTY */ }
00188   
00189  
00190   virtual void warning(const SAXParseException& exception)
00191   { /* EMPTY */ }
00192 
00193 
00194 //@}
00195 
00196 // -------------------------------------------------------------------
00197 
00198 }; // class DefaultHandler
00199 
00200 } // namespace qgxml
00201 
00202 
00203 #endif /* __DEFAULTHANDLER_H_INCLUDED__ */