/* docObjectIface.h A base class for classes that can be the result of parsing XML documents with the expatParse class. All of the callback methods do nothing by default. Override only the ones you want to, but BE SURE to declare friend class expatParser in your subclass so that the callbacks can be called during parsing. http://projects.zillabit.com/xml.html Copyright (c) 2000, Earl Levine All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -The name of Earl Levine may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _DOCOBJECTIFACE_H_ #define _DOCOBJECTIFACE_H_ #include "expatParser.h" class docObjectIface { friend class expatParser; protected: // Expat callback handlers. See the explanations of the corresponding // functions in xmlparse.h virtual void StartElementHandler(const XML_Char *name, const XML_Char **atts) {} virtual void EndElementHandler(const XML_Char *name) {} virtual void CharacterDataHandler(const XML_Char *s, int len) {} virtual void ProcessingInstructionHandler(const XML_Char *target, const XML_Char *data) {} virtual void CommentHandler(const XML_Char *data) {} virtual void StartCdataSectionHandler() {} virtual void EndCdataSectionHandler() {} virtual void DefaultHandler(const XML_Char *s, int len) {} virtual void UnparsedEntityDeclHandler(const XML_Char *entityName, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId, const XML_Char *notationName) {} virtual void NotationDeclHandler(const XML_Char *notationName, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId) {} virtual void StartNamespaceDeclHandler(const XML_Char *prefix, const XML_Char *uri) {} virtual void EndNamespaceDeclHandler(const XML_Char *prefix) {} // There are other handlers declared in xmlparse.h that could be added here... }; #endif /* _DOCOBJECTIFACE_H_ */