domnodeimpl.hpp

来自「IBM的解析xml的工具Xerces的源代码」· HPP 代码 · 共 381 行 · 第 1/2 页

HPP
381
字号
    }    inline bool isFirstChild() const {        return (flags & FIRSTCHILD) != 0;    }    inline void isFirstChild(bool value) {        flags = (value ? flags | FIRSTCHILD : flags & ~FIRSTCHILD);    }    inline bool isSpecified() const {        return (flags & SPECIFIED) != 0;    }    inline void isSpecified(bool value) {        flags = (value ? flags | SPECIFIED : flags & ~SPECIFIED);    }    inline bool ignorableWhitespace() const {        return (flags & IGNORABLEWS) != 0;    }    inline void ignorableWhitespace(bool value) {        flags = (value ? flags | IGNORABLEWS : flags & ~IGNORABLEWS);    }    inline bool setValue() const {        return (flags & SETVALUE) != 0;    }    inline void setValue(bool value) {        flags = (value ? flags | SETVALUE : flags & ~SETVALUE);    }    inline bool isIdAttr() const {        return (flags & ID_ATTR) != 0;    }    inline void isIdAttr(bool value) {        flags = (value ? flags | ID_ATTR : flags & ~ID_ATTR);    }    inline bool hasUserData() const {        return (flags & USERDATA) != 0;    }    inline void hasUserData(bool value) {        flags = (value ? flags | USERDATA : flags & ~USERDATA);    }    //    //  LeafNode is set true for node types that can not be ParentNodes (can't have children)    //    This knowledge is used to allow casting from any unknown node type to the    //    IDParentImpl or IDChildImpl parts of the node.    //    inline bool isLeafNode() const {        return (flags & LEAFNODETYPE) != 0;    }    inline void setIsLeafNode(bool value) {        flags = (value ? flags | LEAFNODETYPE : flags & ~LEAFNODETYPE);    }    //    // ChildNode is set true for node types that can be children of other nodes, and    //   therefore include a DOMChildNode data member.  Note that all of the leaf    //   node types (above flag) are also ChildNodes, but not all ChildNodes are    //   leaf nodes.    inline bool isChildNode() const {        return (flags & CHILDNODE) != 0;    }    inline void setIsChildNode(bool value) {        flags = (value ? flags | CHILDNODE : flags & ~CHILDNODE);    }    // True if this node has to be released regardless if it has a owner or not    // This is true if called from fParent->release()    inline bool isToBeReleased() const {        return (flags & TOBERELEASED) != 0;    }    inline void isToBeReleased(bool value) {        flags = (value ? flags | TOBERELEASED : flags & ~TOBERELEASED);    }};// This macro lists all of the pure virtual functions declared in DOMNode that must//   be implemented by all node types.  Since there is no inheritance of implementation,//   using this macro in the class declaration of the node types make it easier to//   accurately get all of the functions declared.//#define DOMNODE_FUNCTIONS \    virtual       DOMNode*         appendChild(DOMNode *newChild) ;\    virtual       DOMNode*         cloneNode(bool deep) const ;\    virtual       DOMNamedNodeMap* getAttributes() const ;\    virtual       DOMNodeList*     getChildNodes() const ;\    virtual       DOMNode*         getFirstChild() const ;\    virtual       DOMNode*         getLastChild() const ;\    virtual const XMLCh*           getLocalName() const ;\    virtual const XMLCh*           getNamespaceURI() const ;\    virtual       DOMNode*         getNextSibling() const ;\    virtual const XMLCh*           getNodeName() const ;\    virtual       short            getNodeType() const ;\    virtual const XMLCh*           getNodeValue() const ;\    virtual       DOMDocument*     getOwnerDocument() const ;\    virtual const XMLCh*           getPrefix() const ;\    virtual       DOMNode*         getParentNode() const ;\    virtual       DOMNode*         getPreviousSibling() const ;\    virtual       bool             hasChildNodes() const ;\    virtual       DOMNode*         insertBefore(DOMNode *newChild, DOMNode *refChild) ;\    virtual       void             normalize() ;\    virtual       DOMNode*         removeChild(DOMNode *oldChild) ;\    virtual       DOMNode*         replaceChild(DOMNode *newChild, DOMNode *oldChild) ;\    virtual       void             setNodeValue(const XMLCh  *nodeValue) ;\    virtual       bool             isSupported(const XMLCh *feature, const XMLCh *version) const ;\    virtual       bool             hasAttributes() const ;\    virtual       void             setPrefix(const XMLCh * prefix) ;\    virtual       void*            setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler) ;\    virtual       void*            getUserData(const XMLCh* key) const ;\    virtual       bool             isSameNode(const DOMNode* other) const;\    virtual       bool             isEqualNode(const DOMNode* arg) const;\    virtual const XMLCh*           getBaseURI() const ;\    virtual short                  compareTreePosition(const DOMNode* other) const ;\    virtual const XMLCh*           getTextContent() const ;\            const XMLCh*           getTextContent(XMLCh* pzBuffer, unsigned int& rnBufferLength) const;\    virtual void                   setTextContent(const XMLCh* textContent) ;\    virtual const XMLCh*           lookupNamespacePrefix(const XMLCh* namespaceURI, bool useDefault) const  ;\    virtual bool                   isDefaultNamespace(const XMLCh* namespaceURI) const;\    virtual const XMLCh*           lookupNamespaceURI(const XMLCh* prefix) const  ;\    virtual       DOMNode*         getInterface(const XMLCh* feature) ;\    virtual       void             release()/* *  Here are dummy stubs for most of the functions introduced by DOMNode. *    Each subclass of DOMNode will have something like this that delegates each *    function to the appropriate implementation. *    Functions that must be supplied by every node class are omitted. *           DOMNode*         xxx::appendChild(DOMNode *newChild)          {return fParent.appendChild (newChild); };           DOMNamedNodeMap* xxx::getAttributes() const                   {return fNode.getAttributes (); };           DOMNodeList*     xxx::getChildNodes() const                   {return fParent.getChildNodes (); };           DOMNode*         xxx::getFirstChild() const                   {return fParent.getFirstChild (); };           DOMNode*         xxx::getLastChild() const                    {return fParent.getLastChild (); };     const XMLCh*           xxx::getLocalName() const                    {return fNode.getLocalName (); };     const XMLCh*           xxx::getNamespaceURI() const                 {return fNode.getNamespaceURI (); };           DOMNode*         xxx::getNextSibling() const                  {return fChild.getNextSibling (); };     const XMLCh*           xxx::getNodeValue() const                    {return fNode.getNodeValue (); };           DOMDocument*     xxx::getOwnerDocument() const                {return fNode.getOwnerDocument (); };     const XMLCh*           xxx::getPrefix() const                       {return fNode.getPrefix (); };           DOMNode*         xxx::getParentNode() const                   {return fChild.getParentNode (this); };           DOMNode*         xxx::getPreviousSibling() const              {return fChild.getPreviousSibling (this); };           bool             xxx::hasChildNodes() const                   {return fParent.hasChildNodes (); };           DOMNode*         xxx::insertBefore(DOMNode *newChild, DOMNode *refChild)                                                                         {return fParent.insertBefore (newChild, refChild); };           void             xxx::normalize()                             {fParent.normalize(); };           DOMNode*         xxx::removeChild(DOMNode *oldChild)          {return fParent.removeChild (oldChild); };           DOMNode*         xxx::replaceChild(DOMNode *newChild, DOMNode *oldChild)                                                                         {return fParent.replaceChild (newChild, oldChild); };           bool             xxx::isSupported(const XMLCh *feature, const XMLCh *version) const                                                                         {return fNode.isSupported (feature, version); };           void             xxx::setPrefix(const XMLCh  *prefix)         {fNode.setPrefix(prefix); };           bool             xxx::hasAttributes() const                   {return fNode.hasAttributes(); };           bool             xxx::isSameNode(const DOMNode* other) const  {return fNode.isSameNode(other); };           bool             xxx::isEqualNode(const DOMNode* arg) const   {return fNode.isEqualNode(arg); };           void*            xxx::setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler)                                                                         {return fNode.setUserData(key, data, handler); };           void*            xxx::getUserData(const XMLCh* key) const     {return fNode.getUserData(key); };           const XMLCh*     xxx::getBaseURI() const                      {return fNode.getBaseURI(); };           short            xxx::compareTreePosition(const DOMNode* other) const {return fNode.compareTreePosition(other); };           const XMLCh*     xxx::getTextContent() const                  {return fNode.getTextContent(); };           void             xxx::setTextContent(const XMLCh* textContent){fNode.setTextContent(textContent); };           const XMLCh*     xxx::lookupNamespacePrefix(const XMLCh* namespaceURI, bool useDefault) const {return fNode.lookupNamespacePrefix(namespaceURI, useDefault); };           bool             xxx::isDefaultNamespace(const XMLCh* namespaceURI) const {return fNode.isDefaultNamespace(namespaceURI); };           const XMLCh*     xxx::lookupNamespaceURI(const XMLCh* prefix) const {return fNode.lookupNamespaceURI(prefix); };           DOMNode*         xxx::getInterface(const XMLCh* feature)      {return fNode.getInterface(feature); };*/XERCES_CPP_NAMESPACE_END#endif

⌨️ 快捷键说明

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