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

📄 domparser.hpp

📁 经典开源游戏glest的源代码
💻 HPP
📖 第 1 页 / 共 5 页
字号:
    /**      * This method allows the user to specify a list of schemas to use.      * If the targetNamespace of a schema specified using this method matches      * the targetNamespace of a schema occuring in the instance document in      * the schemaLocation attribute, or if the targetNamespace matches the      * namespace attribute of the "import" element, the schema specified by the      * user using this method will be used (i.e., the schemaLocation attribute      * in the instance document or on the "import" element will be effectively ignored).      *      * If this method is called more than once, only the last one takes effect.      *      * The syntax is the same as for schemaLocation attributes in instance      * documents: e.g, "http://www.example.com file_name.xsd". The user can      * specify more than one XML Schema in the list.      *      * @param schemaLocation the list of schemas to use      *      * @see #getExternalSchemaLocation      */    void setExternalSchemaLocation(const XMLCh* const schemaLocation);    /**      * This method is same as setExternalSchemaLocation(const XMLCh* const).      * It takes native char string as parameter      *      * @param schemaLocation the list of schemas to use      *      * @see #setExternalSchemaLocation(const XMLCh* const)      */    void setExternalSchemaLocation(const char* const schemaLocation);    /**      * This method allows the user to specify the no target namespace XML      * Schema Location externally.  If specified, the instance document's      * noNamespaceSchemaLocation attribute will be effectively ignored.      *      * If this method is called more than once, only the last one takes effect.      *      * The syntax is the same as for the noNamespaceSchemaLocation attribute      * that may occur in an instance document: e.g."file_name.xsd".      *      * @param noNamespaceSchemaLocation the XML Schema Location with no target namespace      *      * @see #getExternalNoNamespaceSchemaLocation      */    void setExternalNoNamespaceSchemaLocation(const XMLCh* const noNamespaceSchemaLocation);    /**      * This method is same as setExternalNoNamespaceSchemaLocation(const XMLCh* const).      * It takes native char string as parameter      *      * @param noNamespaceSchemaLocation the XML Schema Location with no target namespace      *      * @see #setExternalNoNamespaceSchemaLocation(const XMLCh* const)      */    void setExternalNoNamespaceSchemaLocation(const char* const noNamespaceSchemaLocation);    /** Set the 'Grammar caching' flag      *      * This method allows users to enable or disable caching of grammar when      * parsing XML documents. When set to true, the parser will cache the      * resulting grammar for use in subsequent parses.      *      * If the flag is set to true, the 'Use cached grammar' flag will also be      * set to true.      *      * The parser's default state is: false.      *      * @param newState The value specifying whether we should cache grammars      *                 or not.      *      * @see #isCachingGrammarFromParse      * @see #useCachedGrammarInParse      */    void cacheGrammarFromParse(const bool newState);    /** Set the 'Use cached grammar' flag      *      * This method allows users to enable or disable the use of cached      * grammars.  When set to true, the parser will use the cached grammar,      * instead of building the grammar from scratch, to validate XML      * documents.      *      * If the 'Grammar caching' flag is set to true, this mehod ignore the      * value passed in.      *      * The parser's default state is: false.      *      * @param newState The value specifying whether we should use the cached      *                 grammar or not.      *      * @see #isUsingCachedGrammarInParse      * @see #cacheGrammarFromParse      */    void useCachedGrammarInParse(const bool newState);    /** Enable/disable src offset calculation      *      * This method allows users to enable/disable src offset calculation.      * Disabling the calculation will improve performance.      *      * The parser's default state is: false.      *      * @param newState The value specifying whether we should enable or      *                 disable src offset calculation      *      * @see #getCalculateSrcOfs      */    void setCalculateSrcOfs(const bool newState);    /** Force standard uri      *      * This method allows users to tell the parser to force standard uri conformance.      *      * The parser's default state is: false.      *      * @param newState The value specifying whether the parser should reject malformed URI.      *      * @see #getStandardUriConformant      */    void setStandardUriConformant(const bool newState);    /** Set the scanner to use when scanning the XML document      *      * This method allows users to set the scanner to use      * when scanning a given XML document.      *      * @param scannerName The name of the desired scanner      */    void useScanner(const XMLCh* const scannerName);    //@}    // -----------------------------------------------------------------------    //  Parsing methods    // -----------------------------------------------------------------------    /** @name Parsing methods */    //@{    /** Parse via an input source object      *      * This method invokes the parsing process on the XML file specified      * by the InputSource parameter. This API is borrowed from the      * SAX Parser interface.      *      * @param source A const reference to the InputSource object which      *               points to the XML file to be parsed.      * @exception SAXException Any SAX exception, possibly      *            wrapping another exception.      * @exception XMLException An exception from the parser or client      *            handler code.      * @exception DOM_DOMException A DOM exception as per DOM spec.      * @see InputSource#InputSource      * @see #setEntityResolver      * @see #setErrorHandler      */    void parse(const InputSource& source);    /** Parse via a file path or URL      *      * This method invokes the parsing process on the XML file specified by      * the Unicode string parameter 'systemId'. This method is borrowed      * from the SAX Parser interface.      *      * @param systemId A const XMLCh pointer to the Unicode string which      *                 contains the path to the XML file to be parsed.      *      * @exception SAXException Any SAX exception, possibly      *            wrapping another exception.      * @exception XMLException An exception from the parser or client      *            handler code.      * @exception DOM_DOMException A DOM exception as per DOM spec.      * @see #parse(InputSource,...)      */    void parse(const XMLCh* const systemId);    /** Parse via a file path or URL (in the local code page)      *      * This method invokes the parsing process on the XML file specified by      * the native char* string parameter 'systemId'.      *      * @param systemId A const char pointer to a native string which      *                 contains the path to the XML file to be parsed.      * @exception SAXException Any SAX exception, possibly      *            wrapping another exception.      * @exception XMLException An exception from the parser or client      *            handler code.      * @exception DOM_DOMException A DOM exception as per DOM spec.      * @see #parse(InputSource,...)      */    void parse(const char* const systemId);    /** 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      *         returns 'false' to indicate that the parser could not parse      *         the prolog.      *      * @see #parseNext      * @see #parseFirst(char*,...)      * @see #parseFirst(InputSource&,...)      */    bool parseFirst    (        const   XMLCh* const    systemId        ,       XMLPScanToken&  toFill    );    /** 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 regular native 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      *         returns 'false' to indicate that the parser could not parse      *         the prolog.      *      * @see #parseNext      * @see #parseFirst(XMLCh*,...)      * @see #parseFirst(InputSource&,...)      */    bool parseFirst    (        const   char* const     systemId        ,       XMLPScanToken&  toFill    );    /** 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 source   A const reference to the InputSource object which      *                 points 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      *         returns 'false' to indicate that the parser could not parse      *         the prolog.      *      * @see #parseNext      * @see #parseFirst(XMLCh*,...)      * @see #parseFirst(char*,...)      */    bool parseFirst    (        const   InputSource&    source        ,       XMLPScanToken&  toFill    );    /** Continue a progressive parse operation      *      * This method is used to continue with progressive parsing of      * XML files started by a call to 'parseFirst' method.      *      * It parses the XML file and stops as soon as it comes across      * a XML token (as defined in the XML specification).      *      * @param token A token maintaing state information to maintain      *              internal consistency between invocation of 'parseNext'      *              calls.      *      * @return 'true', if successful in parsing the next XML token.      *         It indicates the user can go ahead with parsing the rest      *         of the file. It returns 'false' to indicate that the parser      *         could not find next token as per the XML specification      *         production rule.      *      * @see #parseFirst(XMLCh*,...)      * @see #parseFirst(char*,...)      * @see #parseFirst(InputSource&,...)      */    bool parseNext(XMLPScanToken& token);    /** Reset the parser after a progressive parse      *      * If a progressive parse loop exits before the end of the document      * is reached, the parser has no way of knowing this. So it will leave      * open any files or sockets or memory buffers that were in use at      * the time that the parse loop exited.      *      * The next parse operation will cause these open files and such to      * be closed, but the next parse operation might occur at some unknown      * future point. To avoid this problem, you should reset the parser if      * you exit the loop early.      *      * If you exited because of an error, then this cleanup will be done      * for you. Its only when you exit the file prematurely of your own      * accord, because you've found what you wanted in the file most      * likely.      *      * @param token A token maintaing state information to maintain      *              internal consistency between invocation of 'parseNext'      *              calls.      *      * @see #parseFirst(XMLCh*,...)      * @see #parseFirst(char*,...)      * @see #parseFirst(InputSource&,...)      */    void parseReset(XMLPScanToken& token);    //@}    // -----------------------------------------------------------------------    //  Grammar preparsing interface    // -----------------------------------------------------------------------    /** @name Implementation of Grammar preparsing interface's. */

⌨️ 快捷键说明

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