domdocumentimpl.hpp
来自「IBM的解析xml的工具Xerces的源代码」· HPP 代码 · 共 399 行 · 第 1/2 页
HPP
399 行
#ifndef DOMDocumentImpl_HEADER_GUARD_#define DOMDocumentImpl_HEADER_GUARD_/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *//* * $Id: DOMDocumentImpl.hpp,v 1.25 2004/09/08 13:55:51 peiyongz Exp $ *///// This file is part of the internal implementation of the C++ XML DOM.// It should NOT be included or used directly by application programs.//// Applications should include the file <xercesc/dom/DOM.hpp> for the entire// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class// name is substituded for the *.//#include <xercesc/util/RefArrayOf.hpp>#include <xercesc/util/RefStackOf.hpp>#include <xercesc/util/RefHash2KeysTableOf.hpp>#include <xercesc/util/StringPool.hpp>#include <xercesc/util/KeyRefPair.hpp>#include <xercesc/dom/DOMDocument.hpp>#include <xercesc/dom/DOMUserDataHandler.hpp>#include "DOMNodeImpl.hpp"#include "DOMParentNode.hpp"#include "DOMDeepNodeListPool.hpp"XERCES_CPP_NAMESPACE_BEGINclass DOMAttrImpl;class DOMCDATASectionImpl;class DOMCommentImpl;class DOMConfiguration;class DOMDeepNodeListImpl;class DOMDocumentFragmentImpl;class DOMDocumentTypeImpl;class DOMElementImpl;class DOMEntityImpl;class DOMEntityReferenceImpl;class DOMNotationImpl;class DOMProcessingInstructionImpl;class DOMTextImpl;class DOMNodeIteratorImpl;class DOMNormalizer;class DOMTreeWalkerImpl;class DOMNodeFilter;class DOMNodeFilterImpl;class DOMImplementation;class DOMNodeIDMap;class DOMRangeImpl;class DOMStringPool;class DOMBuffer;class MemoryManager;class XPathNSResolver;class XPathExpression;typedef RefVectorOf<DOMRangeImpl> Ranges;typedef RefVectorOf<DOMNodeIteratorImpl> NodeIterators;typedef KeyRefPair<void, DOMUserDataHandler> DOMUserDataRecord;typedef RefStackOf<DOMNode> DOMNodePtr;class CDOM_EXPORT DOMDocumentImpl: public XMemory, public DOMDocument {public: // ----------------------------------------------------------------------- // data types // ----------------------------------------------------------------------- enum NodeObjectType { ATTR_OBJECT = 0, ATTR_NS_OBJECT = 1, CDATA_SECTION_OBJECT = 2, COMMENT_OBJECT = 3, DOCUMENT_FRAGMENT_OBJECT = 4, DOCUMENT_TYPE_OBJECT = 5, ELEMENT_OBJECT = 6, ELEMENT_NS_OBJECT = 7, ENTITY_OBJECT = 8, ENTITY_REFERENCE_OBJECT = 9, NOTATION_OBJECT = 10, PROCESSING_INSTRUCTION_OBJECT = 11, TEXT_OBJECT = 12 }; // ----------------------------------------------------------------------- // data // ----------------------------------------------------------------------- DOMNodeImpl fNode; // Implements common node functionality. DOMParentNode fParent; // Implements common parent node functionality DOMNodeIDMap* fNodeIDMap; // for use by GetElementsById().public: DOMDocumentImpl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); DOMDocumentImpl(const XMLCh* namespaceURI, //DOM Level 2 const XMLCh* qualifiedName, DOMDocumentType* doctype, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); virtual ~DOMDocumentImpl(); void setDocumentType(DOMDocumentType *doctype); // Add all functions that are pure virutal in DOMNODE DOMNODE_FUNCTIONS; // Add all functions that are pure virutal in DOMDocument virtual DOMAttr* createAttribute(const XMLCh *name); virtual DOMCDATASection* createCDATASection(const XMLCh *data); virtual DOMComment* createComment(const XMLCh *data); virtual DOMDocumentFragment* createDocumentFragment(); virtual DOMDocumentType* createDocumentType(const XMLCh *name); virtual DOMDocumentType* createDocumentType(const XMLCh *qName, const XMLCh *publicId, const XMLCh *systemId); virtual DOMElement* createElement(const XMLCh * tagName); virtual DOMElement* createElementNoCheck(const XMLCh *tagName); virtual DOMEntity* createEntity(const XMLCh * name); virtual DOMEntityReference* createEntityReference(const XMLCh * name); virtual DOMNotation* createNotation(const XMLCh * name); virtual DOMProcessingInstruction* createProcessingInstruction(const XMLCh * target, const XMLCh * data); virtual DOMText* createTextNode(const XMLCh * data); virtual DOMDocumentType* getDoctype() const; virtual DOMElement* getDocumentElement() const; virtual DOMNodeList* getElementsByTagName(const XMLCh * tagname) const; virtual DOMImplementation* getImplementation() const; bool isXMLName(const XMLCh * s); virtual DOMNodeIterator* createNodeIterator(DOMNode *root, unsigned long whatToShow, DOMNodeFilter* filter, bool entityReferenceExpansion); virtual DOMTreeWalker* createTreeWalker(DOMNode *root, unsigned long whatToShow, DOMNodeFilter* filter, bool entityReferenceExpansion); virtual DOMRange* createRange(); virtual Ranges* getRanges() const; //non-standard api virtual NodeIterators* getNodeIterators() const; //non-standard api virtual void removeRange(DOMRangeImpl* range); //non-standard api virtual void removeNodeIterator(DOMNodeIteratorImpl* nodeIterator); //non-standard api virtual const DOMXPathExpression* createExpression(const XMLCh *expression, const DOMXPathNSResolver *resolver); virtual const DOMXPathNSResolver* createNSResolver(DOMNode *nodeResolver); virtual void* evaluate(const XMLCh *expression, DOMNode *contextNode, const DOMXPathNSResolver *resolver, unsigned short type, void* result); // Extension to be called by the Parser DOMEntityReference* createEntityReferenceByParser(const XMLCh * name); // // Functions to keep track of document mutations, so that node list chached // information can be invalidated. One global changes counter per document. // virtual void changed(); virtual int changes() const; /** * Sets whether the DOM implementation performs error checking * upon operations. Turning off error checking only affects * the following DOM checks: * <ul> * <li>Checking strings to make sure that all characters are * legal XML characters * <li>Hierarchy checking such as allowed children, checks for * cycles, etc. * </ul> * <p> * Turning off error checking does <em>not</em> turn off the * following checks: * <ul> * <li>Read only checks * <li>Checks related to DOM events * </ul> */ inline void setErrorChecking(bool check) { errorChecking = check; } /** * Returns true if the DOM implementation performs error checking. */ inline bool getErrorChecking() const {
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?