00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file XMLReader.h 00006 * 00007 * XMLReader.h,v 1.7 2005/04/20 16:22:53 ossama Exp 00008 * 00009 * @author Nanbor Wang <nanbor@cs.wustl.edu> 00010 */ 00011 //============================================================================= 00012 #ifndef _ACEXML_XMLREADER_H_ 00013 #define _ACEXML_XMLREADER_H_ 00014 00015 #include /**/ "ace/pre.h" 00016 #include "ACEXML/common/ACEXML_Export.h" 00017 00018 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00019 #pragma once 00020 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00021 00022 #include "ACEXML/common/ContentHandler.h" 00023 #include "ACEXML/common/DTDHandler.h" 00024 #include "ACEXML/common/EntityResolver.h" 00025 #include "ACEXML/common/ErrorHandler.h" 00026 00027 /** 00028 * @class ACEXML_XMLReader XMLReader.h "ACEXML/common/XMLReader.h" 00029 * 00030 * @brief ACEXML_XMLReader 00031 * 00032 * XMLReader is the interface that an XML parser's SAX2 driver must 00033 * implement. This interface allows an application to set and query 00034 * features and properties in the parser, to register event handlers 00035 * for document processing, and to initiate a document parse. 00036 * 00037 * All SAX interfaces are assumed to be synchronous: the parse methods 00038 * must not return until parsing is complete, and readers must wait 00039 * for an event-handler callback to return before reporting the next 00040 * event. 00041 */ 00042 class ACEXML_Export ACEXML_XMLReader 00043 { 00044 public: 00045 00046 virtual ~ACEXML_XMLReader (void); 00047 00048 /** 00049 * Return the current content handler. 00050 */ 00051 virtual ACEXML_ContentHandler *getContentHandler (void) const = 0; 00052 00053 /** 00054 * Return the current DTD handler. 00055 */ 00056 virtual ACEXML_DTDHandler *getDTDHandler (void) const = 0; 00057 00058 /** 00059 * Return the current entity resolver. 00060 */ 00061 virtual ACEXML_EntityResolver *getEntityResolver (void) const = 0; 00062 00063 /** 00064 * Return the current error handler. 00065 */ 00066 virtual ACEXML_ErrorHandler *getErrorHandler (void) const = 0; 00067 00068 /** 00069 * Look up the value of a feature. This method allows 00070 * programmers to check whether a specific feature has been 00071 * activated in the parser. 00072 */ 00073 virtual int getFeature (const ACEXML_Char *name ACEXML_ENV_ARG_DECL) 00074 ACE_THROW_SPEC ((ACEXML_SAXNotRecognizedException, 00075 ACEXML_SAXNotSupportedException)) = 0; 00076 00077 /** 00078 * Look up the value of a property. 00079 */ 00080 virtual void * getProperty (const ACEXML_Char *name ACEXML_ENV_ARG_DECL) 00081 ACE_THROW_SPEC ((ACEXML_SAXNotRecognizedException, 00082 ACEXML_SAXNotSupportedException)) = 0; 00083 00084 /** 00085 * Parse an XML document. 00086 */ 00087 virtual void parse (ACEXML_InputSource *input ACEXML_ENV_ARG_DECL) 00088 ACE_THROW_SPEC ((ACEXML_SAXException)) = 0; 00089 00090 /** 00091 * Parse an XML document from a system identifier (URI). 00092 */ 00093 virtual void parse (const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL) 00094 ACE_THROW_SPEC ((ACEXML_SAXException)) = 0; 00095 00096 /** 00097 * Allow an application to register a content event handler. 00098 */ 00099 virtual void setContentHandler (ACEXML_ContentHandler *handler) = 0; 00100 00101 /** 00102 * Allow an application to register a DTD event handler. 00103 */ 00104 virtual void setDTDHandler (ACEXML_DTDHandler *handler) = 0; 00105 00106 /** 00107 * Allow an application to register an entity resolver. 00108 */ 00109 virtual void setEntityResolver (ACEXML_EntityResolver *resolver) = 0; 00110 00111 /** 00112 * Allow an application to register an error event handler. 00113 */ 00114 virtual void setErrorHandler (ACEXML_ErrorHandler *handler) = 0; 00115 00116 /** 00117 * Activating or deactivating a feature. 00118 */ 00119 virtual void setFeature (const ACEXML_Char *name, 00120 int boolean_value ACEXML_ENV_ARG_DECL) 00121 ACE_THROW_SPEC ((ACEXML_SAXNotRecognizedException, 00122 ACEXML_SAXNotSupportedException)) = 0; 00123 00124 /** 00125 * Set the value of a property. 00126 */ 00127 virtual void setProperty (const ACEXML_Char *name, 00128 void *value ACEXML_ENV_ARG_DECL) 00129 ACE_THROW_SPEC ((ACEXML_SAXNotRecognizedException, 00130 ACEXML_SAXNotSupportedException)) = 0; 00131 }; 00132 00133 00134 #include /**/ "ace/post.h" 00135 00136 #endif /* _ACEXML_XMLREADER_H_ */