source: icXML/icXML-devel/src/xercesc/dom/impl/DOMParentNode.hpp @ 2722

Last change on this file since 2722 was 2722, checked in by cameron, 6 years ago

Original Xerces files with import mods for icxercesc

File size: 3.7 KB
Line 
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements.  See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License.  You may obtain a copy of the License at
8 *
9 *      http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18/*
19 * $Id: DOMParentNode.hpp 678709 2008-07-22 10:56:56Z borisk $
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_DOMPARENTNODE_HPP)
23#define XERCESC_INCLUDE_GUARD_DOMPARENTNODE_HPP
24
25//
26//  This file is part of the internal implementation of the C++ XML DOM.
27//  It should NOT be included or used directly by application programs.
28//
29//  Applications should include the file <xercesc/dom/DOM.hpp> for the entire
30//  DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
31//  name is substituded for the *.
32//
33
34/**
35 * ParentNode provides the capability of having child
36 * nodes. Not every node in the DOM can have children, so only nodes that can
37 * should include this class and pay the price for it.
38 * <P>
39 * While we have a direct reference to the first child, the last child is
40 * stored as the previous sibling of the first child. First child nodes are
41 * marked as being so, and getNextSibling hides this fact.
42 *
43 **/
44
45#include <xercesc/util/XercesDefs.hpp>
46#include "DOMNodeListImpl.hpp"
47
48XERCES_CPP_NAMESPACE_BEGIN
49
50
51class DOMChildNode;
52class DOMDocument;
53class DOMNode;
54class DOMNodeList;
55
56class CDOM_EXPORT DOMParentNode  {
57public:
58    DOMDocument            *fOwnerDocument; // Document this node belongs to
59    DOMNode                *fFirstChild;
60    DOMNodeListImpl            fChildNodeList;      // for GetChildNodes()
61
62public:
63    DOMParentNode(DOMDocument *ownerDocument);
64    DOMParentNode(const DOMParentNode &other);
65
66    DOMDocument * getOwnerDocument() const;
67    void setOwnerDocument(DOMDocument* doc);
68
69    // Track changes to the node tree structure under this node.  An optimization
70    //   for NodeLists.
71    int changes() const;
72    void changed();
73
74    DOMNode*     appendChild(DOMNode *newChild);
75    DOMNodeList* getChildNodes() const;
76    DOMNode*     getFirstChild() const;
77    DOMNode*     getLastChild() const;
78    bool         hasChildNodes() const;
79    DOMNode*     insertBefore(DOMNode *newChild, DOMNode *refChild);
80    DOMNode*     item(unsigned int index) const;
81    DOMNode*     removeChild(DOMNode *oldChild);
82    DOMNode*     replaceChild(DOMNode *newChild, DOMNode *oldChild);
83
84    // Append certain types of nodes fast. Used to speed up XML to DOM
85    // parsing. See the function implementation for detail.
86    virtual DOMNode*     appendChildFast(DOMNode *newChild);
87
88    //Introduced in DOM Level 2
89    void        normalize();
90
91    //Introduced in DOM Level 3
92    bool isEqualNode(const DOMNode* arg) const;
93
94    // NON-DOM
95    // unlike getOwnerDocument this never returns null, even for Document nodes
96    DOMDocument * getDocument() const;
97    void          release();
98
99
100public:
101    void cloneChildren(const DOMNode *other);
102    DOMNode * lastChild() const;
103    void lastChild(DOMNode *);
104
105private:
106    // unimplemented
107    DOMParentNode& operator= (const DOMParentNode& other);
108};
109
110#define GetDOMParentNodeMemoryManager GET_DIRECT_MM(fOwnerDocument)
111
112XERCES_CPP_NAMESPACE_END
113
114#endif
Note: See TracBrowser for help on using the repository browser.