📄 abstractdomparser.hpp
字号:
virtual void endAttList ( const DTDElementDecl& elemDecl ); virtual void endIntSubset(); virtual void endExtSubset(); virtual void entityDecl ( const DTDEntityDecl& entityDecl , const bool isPEDecl , const bool isIgnored ); virtual void resetDocType(); virtual void notationDecl ( const XMLNotationDecl& notDecl , const bool isIgnored ); virtual void startAttList ( const DTDElementDecl& elemDecl ); virtual void startIntSubset(); virtual void startExtSubset(); virtual void TextDecl ( const XMLCh* const versionStr , const XMLCh* const encodingStr ); //@} // ----------------------------------------------------------------------- // Deprecated Methods // ----------------------------------------------------------------------- /** @name Deprecated Methods */ //@{ /** * This method returns the state of the parser's validation * handling flag which controls whether validation checks * are enforced or not. * * @return true, if the parser is currently configured to * do validation, false otherwise. * * @see #setDoValidation */ bool getDoValidation() const; /** * This method allows users to enable or disable the parser's validation * checks. * * <p>By default, the parser does not to any validation. The default * value is false.</p> * * @param newState The value specifying whether the parser should * do validity checks or not against the DTD in the * input XML document. * * @see #getDoValidation */ void setDoValidation(const bool newState); /** Get the 'expand entity references' flag. * DEPRECATED Use getCreateEntityReferenceNodes() instead. * * This method returns the state of the parser's expand entity * references flag. * * @return 'true' if the expand entity reference flag is set on * the parser, 'false' otherwise. * * @see #setExpandEntityReferences * @see #setCreateEntityReferenceNodes * @see #getCreateEntityReferenceNodes */ bool getExpandEntityReferences() const; /** Set the 'expand entity references' flag * * DEPRECATED. USE setCreateEntityReferenceNodes instead. * This method allows the user to specify whether the parser should * expand all entity reference nodes. When the 'do expansion' flag is * true, the DOM tree does not have any entity reference nodes. It is * replaced by the sub-tree representing the replacement text of the * entity. When the 'do expansion' flag is false, the DOM tree * contains an extra entity reference node, whose children is the * sub tree of the replacement text. * <p>The default value is 'false'. * * @param expand The new state of the expand entity reference * flag. * @see #setCreateEntityReferenceNodes */ void setExpandEntityReferences(const bool expand); //@}protected : // ----------------------------------------------------------------------- // Protected Constructor Methods // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** Construct a AbstractDOMParser, with an optional validator * * Constructor with an instance of validator class to use for * validation. If you don't provide a validator, a default one will * be created for you in the scanner. * * @param valToAdopt Pointer to the validator instance to use. The * parser is responsible for freeing the memory. * * @param gramPool Pointer to the grammar pool instance from * external application (through derivatives). * The parser does NOT own it. * * @param manager Pointer to the memory manager to be used to * allocate objects. */ AbstractDOMParser ( XMLValidator* const valToAdopt = 0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager , XMLGrammarPool* const gramPool = 0 ); //@} // ----------------------------------------------------------------------- // Protected getter methods // ----------------------------------------------------------------------- /** @name Protected getter methods */ //@{ /** Get the current DOM node * * This provides derived classes with access to the current node, i.e. * the node to which new nodes are being added. */ DOMNode* getCurrentNode(); /** Get the XML scanner * * This provides derived classes with access to the XML scanner. */ XMLScanner* getScanner() const; /** Get the Grammar resolver * * This provides derived classes with access to the grammar resolver. */ GrammarResolver* getGrammarResolver() const; /** Get the parse in progress flag * * This provides derived classes with access to the parse in progress * flag. */ bool getParseInProgress() const; MemoryManager* getMemoryManager() const; //@} // ----------------------------------------------------------------------- // Protected setter methods // ----------------------------------------------------------------------- /** @name Protected setter methods */ //@{ /** Set the current DOM node * * This method sets the current node maintained inside the parser to * the one specified. * * @param toSet The DOM node which will be the current node. */ void setCurrentNode(DOMNode* toSet); /** Set the document node * * This method sets the DOM Document node to the one specified. * * @param toSet The new DOM Document node for this XML document. */ void setDocument(DOMDocument* toSet); /** Set the parse in progress flag * * This method sets the parse in progress flag to true or false. * * @param toSet The value of the flag to be set. */ void setParseInProgress(const bool toSet); //@} // ----------------------------------------------------------------------- // Protected Helper methods // ----------------------------------------------------------------------- /** @name Protected helper methods */ //@{ virtual DOMElement* createElementNSNode(const XMLCh *fNamespaceURI, const XMLCh *qualifiedName); void resetPool(); /** * Returns true if the user has adopted the document */ bool isDocumentAdopted() const; //@}private : // ----------------------------------------------------------------------- // Initialize/Cleanup methods // ----------------------------------------------------------------------- void initialize(); void cleanUp(); void resetInProgress(); // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- AbstractDOMParser(const AbstractDOMParser&); AbstractDOMParser& operator=(const AbstractDOMParser&);protected: // ----------------------------------------------------------------------- // Protected data members // // fCurrentNode // fCurrentParent // Used to track the current node during nested element events. Since // the tree must be built from a set of disjoint callbacks, we need // these to keep up with where we currently are. // // fCurrentEntity // Used to track the current entity decl. If a text decl is seen later on, // it is used to update the encoding and version information. // // fDocument // The root document object, filled with the document contents. // // fCreateEntityReferenceNodes // Indicates whether entity reference nodes should be created. // // fIncludeIgnorableWhitespace // Indicates whether ignorable whiltespace should be added to // the DOM tree for validating parsers. // // fScanner // The scanner used for this parser. This is created during the // constructor. // // fImplementationFeatures // The implementation features that we use to get an implementation // for use in creating the DOMDocument used during parse. If this is // null then the default DOMImplementation is used // // fNodeStack // Used to track previous parent nodes during nested element events. // // fParseInProgress // Used to prevent multiple entrance to the parser while its doing // a parse. // // fWithinElement // A flag to indicate that the parser is within at least one level // of element processing. // // fDocumentType // Used to store and update the documentType variable information // in fDocument // // fDocumentVector // Store all the previous fDocument(s) (thus not the current fDocument) // created in this parser. It is destroyed when the parser is destructed. // // fCreateCommentNodes // Indicates whether comment nodes should be created. // // fDocumentAdoptedByUser // The DOMDocument ownership has been transferred to application // If set to true, the parser does not own the document anymore // and thus will not release its memory. // // fInternalSubset // Buffer for storing the internal subset information. // Once complete (after DOCTYPE is finished scanning), send // it to DocumentType Node // // fGrammarPool // The grammar pool passed from external application (through derivatives). // which could be 0, not owned. // // fCreateSchemaInfo // Indicates whether element and attributes will have schema info associated // // ----------------------------------------------------------------------- bool fCreateEntityReferenceNodes; bool fIncludeIgnorableWhitespace; bool fWithinElement; bool fParseInProgress; bool fCreateCommentNodes; bool fDocumentAdoptedByUser; bool fCreateSchemaInfo; XMLScanner* fScanner; XMLCh* fImplementationFeatures; DOMNode* fCurrentParent; DOMNode* fCurrentNode; DOMEntity* fCurrentEntity; DOMDocumentImpl* fDocument; ValueStackOf<DOMNode*>* fNodeStack; DOMDocumentTypeImpl* fDocumentType; RefVectorOf<DOMDocumentImpl>* fDocumentVector; GrammarResolver* fGrammarResolver; XMLStringPool* fURIStringPool; XMLValidator* fValidator; MemoryManager* fMemoryManager; XMLGrammarPool* fGrammarPool; XMLBufferMgr fBufMgr; XMLBuffer& fInternalSubset; PSVIHandler* fPSVIHandler;};// ---------------------------------------------------------------------------// AbstractDOMParser: Getter methods// ---------------------------------------------------------------------------inline bool AbstractDOMParser::getExpandEntityReferences() const{ return !fCreateEntityReferenceNodes;}inline
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -