⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sax2xmlreader.hpp

📁 经典开源游戏glest的源代码
💻 HPP
📖 第 1 页 / 共 3 页
字号:
  /**    * Parse an XML document from a system identifier (URI).    *    * This method is a shortcut for the common case of reading a    * document from a system identifier.  It is the exact equivalent    * of the following:    *    * parse(new URLInputSource(systemId));    *    * If the system identifier is a URL, it must be fully resolved    * by the application before it is passed to the parser.    *    * @param systemId The system identifier (URI).    * @exception SAXException Any SAX exception, possibly    *            wrapping another exception.    * @exception XMLException An exception from the parser or client    *            handler code.    * @see #parse(InputSource)    */    virtual void parse    (        const   XMLCh* const    systemId    ) = 0;  /**    * Parse an XML document from a system identifier (URI).    *    * This method is a shortcut for the common case of reading a    * document from a system identifier.  It is the exact equivalent    * of the following:    *    * parse(new URLInputSource(systemId));    *    * If the system identifier is a URL, it must be fully resolved    * by the application before it is passed to the parser.    *    * @param systemId The system identifier (URI).    * @exception SAXException Any SAX exception, possibly    *            wrapping another exception.    * @exception XMLException An exception from the parser or client    *            handler code.    * @see #parse(InputSource)    */    virtual void parse    (        const   char* const     systemId    ) = 0;	    //@}    // -----------------------------------------------------------------------    //  SAX 2.0-ext    // -----------------------------------------------------------------------    /** @name SAX 2.0-ext */    //@{    /**      * This method returns the installed declaration handler.      *      * @return A pointer to the installed declaration handler object.      */    virtual DeclHandler* getDeclarationHandler() const = 0 ;	/**      * This method returns the installed lexical handler.      *      * @return A pointer to the installed lexical handler object.      */    virtual LexicalHandler* getLexicalHandler() const = 0 ;   /**    * Allow an application to register a declaration event handler.    *    * If the application does not register a declaration handler,    * all events reported by the SAX parser will be silently    * ignored. (this is the default behaviour implemented by DefaultHandler).    *    * Applications may register a new or different handler in the    * middle of a parse, and the SAX parser must begin using the new    * handler immediately.    *    * @param handler The DTD declaration handler.    * @see DeclHandler#DeclHandler    * @see SAXException#SAXException    * @see DefaultHandler#DefaultHandler    */    virtual void setDeclarationHandler(DeclHandler* const handler) = 0;   /**    * Allow an application to register a lexical event handler.    *    * If the application does not register a lexical handler,    * all events reported by the SAX parser will be silently    * ignored. (this is the default behaviour implemented by HandlerBase).    *    * Applications may register a new or different handler in the    * middle of a parse, and the SAX parser must begin using the new    * handler immediately.    *    * @param handler The error handler.    * @see LexicalHandler#LexicalHandler    * @see SAXException#SAXException    * @see HandlerBase#HandlerBase    */    virtual void setLexicalHandler(LexicalHandler* const handler) = 0;    //@}    // -----------------------------------------------------------------------    //  Getter Methods    // -----------------------------------------------------------------------    /** @name Getter Methods (Xerces-C specific) */    //@{    /**	  * This method is used to get the current validator.	  *	  * <b>SAX2XMLReader assumes responsibility for the validator.  It will be	  * deleted when the XMLReader is destroyed.</b>	  *	  * @return A pointer to the validator.  An application should not deleted	  * the object returned.	  *	  */	virtual XMLValidator* getValidator() const = 0;    /** Get error count from the last parse operation.      *      * This method returns the error count from the last parse      * operation. Note that this count is actually stored in the      * scanner, so this method simply returns what the      * scanner reports.      *      * @return number of errors encountered during the latest      *			parse operation.      */    virtual int getErrorCount() const = 0 ;    /**      * This method returns the state of the parser's      * exit-on-First-Fatal-Error flag.      *      * <p>Or you can query the feature "http://apache.org/xml/features/continue-after-fatal-error"      * which indicates the opposite state.</p>      *      * @return true, if the parser is currently configured to      *         exit on the first fatal error, false otherwise.      *      * @see #setExitOnFirstFatalError      * @see #getFeature      */    virtual bool getExitOnFirstFatalError() const = 0;    /**      * This method returns the state of the parser's      * validation-constraint-fatal flag.      *      * <p>Or you can query the feature "http://apache.org/xml/features/validation-error-as-fatal"      * which means the same thing.      *      * @return true, if the parser is currently configured to      *         set validation constraint errors as fatal, false      *         otherwise.      *      * @see #setValidationContraintFatal      * @see #getFeature      */    virtual bool getValidationConstraintFatal() const = 0;    /**      * Retrieve the grammar that is associated with the specified namespace key      *      * @param  nameSpaceKey Namespace key      * @return Grammar associated with the Namespace key.      */    virtual Grammar* getGrammar(const XMLCh* const nameSpaceKey) = 0;    /**      * Retrieve the grammar where the root element is declared.      *      * @return Grammar where root element declared      */    virtual Grammar* getRootGrammar() = 0;    /**      * Returns the string corresponding to a URI id from the URI string pool.      *      * @param uriId id of the string in the URI string pool.      * @return URI string corresponding to the URI id.      */    virtual const XMLCh* getURIText(unsigned int uriId) const = 0;    /**      * Returns the current src offset within the input source.      * To be used only while parsing is in progress.      *      * @return offset within the input source      */    virtual unsigned int getSrcOffset() const = 0;    //@}    // -----------------------------------------------------------------------    //  Setter Methods    // -----------------------------------------------------------------------    /** @name Setter Methods (Xerces-C specific) */    //@{    /**	  * This method is used to set a validator.	  *	  * <b>SAX2XMLReader assumes responsibility for the validator.  It will be	  * deleted when the XMLReader is destroyed.</b>	  *	  * @param valueToAdopt A pointer to the validator that the reader should use.	  *	  */	virtual void setValidator(XMLValidator* valueToAdopt) = 0;    /**      * This method allows users to set the parser's behaviour when it      * encounters the first fatal error. If set to true, the parser      * will exit at the first fatal error. If false, then it will      * report the error and continue processing.      *      * <p>The default value is 'true' and the parser exits on the      * first fatal error.</p>      *      * <p>Or you can set the feature "http://apache.org/xml/features/continue-after-fatal-error"      * which has the opposite behaviour.</p>      *      * <p>If both the feature above and this function are used, the latter takes effect.</p>      *      * @param newState The value specifying whether the parser should      *                 continue or exit when it encounters the first      *                 fatal error.      *      * @see #getExitOnFirstFatalError      * @see #setFeature      */    virtual void setExitOnFirstFatalError(const bool newState) = 0;    /**      * This method allows users to set the parser's behaviour when it      * encounters a validtion constraint error. If set to true, and the      * the parser will treat validation error as fatal and will exit depends on the      * state of "getExitOnFirstFatalError". If false, then it will      * report the error and continue processing.      *      * Note: setting this true does not mean the validation error will be printed with      * the word "Fatal Error".   It is still printed as "Error", but the parser      * will exit if "setExitOnFirstFatalError" is set to true.      *      * <p>The default value is 'false'.</p>      *      * <p>Or you can set the feature "http://apache.org/xml/features/validation-error-as-fatal"      * which means the same thing.</p>      *      * <p>If both the feature above and this function are used, the latter takes effect.</p>      *      * @param newState If true, the parser will exit if "setExitOnFirstFatalError"      *                 is set to true.      *      * @see #getValidationConstraintFatal      * @see #setExitOnFirstFatalError      * @see #setFeature      */    virtual void setValidationConstraintFatal(const bool newState) = 0;    //@}    // -----------------------------------------------------------------------    //  Progressive scan methods    // -----------------------------------------------------------------------    /** @name Progressive scan methods */    //@{    /** Begin a progressive parse operation      *      * This method is used to start a progressive parse on a XML file.      * To continue parsing, subsequent calls must be to the parseNext      * method.      *      * It scans through the prolog and returns a token to be used on      * subsequent scanNext() calls. If the return value is true, then the      * token is legal and ready for further use. If it returns false, then      * the scan of the prolog failed and the token is not going to work on      * subsequent scanNext() calls.      *      * @param systemId A pointer to a Unicode string represting the path      *                 to the XML file to be parsed.      * @param toFill   A token maintaing state information to maintain      *                 internal consistency between invocation of 'parseNext'      *                 calls.      *      * @return 'true', if successful in parsing the prolog. It indicates the      *         user can go ahead with parsing the rest of the file. It

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -