1 | #ifndef DOMNodeList_HEADER_GUARD_
|
---|
2 | #define DOMNodeList_HEADER_GUARD_
|
---|
3 |
|
---|
4 | /*
|
---|
5 | * Copyright 2001-2002,2004 The Apache Software Foundation.
|
---|
6 | *
|
---|
7 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
8 | * you may not use this file except in compliance with the License.
|
---|
9 | * You may obtain a copy of the License at
|
---|
10 | *
|
---|
11 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
12 | *
|
---|
13 | * Unless required by applicable law or agreed to in writing, software
|
---|
14 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
16 | * See the License for the specific language governing permissions and
|
---|
17 | * limitations under the License.
|
---|
18 | */
|
---|
19 |
|
---|
20 | /*
|
---|
21 | * $Id: DOMNodeList.hpp,v 1.9 2004/09/08 13:55:39 peiyongz Exp $
|
---|
22 | */
|
---|
23 |
|
---|
24 | #include <xercesc/util/XercesDefs.hpp>
|
---|
25 |
|
---|
26 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
27 |
|
---|
28 |
|
---|
29 | class DOMNode;
|
---|
30 |
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * The <code>DOMNodeList</code> interface provides the abstraction of an ordered
|
---|
34 | * collection of nodes. DOMNodeLists are created by DOMDocument::getElementsByTagName(),
|
---|
35 | * DOMNode::getChildNodes(),
|
---|
36 | *
|
---|
37 | * <p>The items in the <code>DOMNodeList</code> are accessible via an integral
|
---|
38 | * index, starting from 0.
|
---|
39 | *
|
---|
40 | * DOMNodeLists are "live", in that any changes to the document tree are immediately
|
---|
41 | * reflected in any DOMNodeLists that may have been created for that tree.
|
---|
42 | */
|
---|
43 |
|
---|
44 | class CDOM_EXPORT DOMNodeList {
|
---|
45 | protected:
|
---|
46 | // -----------------------------------------------------------------------
|
---|
47 | // Hidden constructors
|
---|
48 | // -----------------------------------------------------------------------
|
---|
49 | /** @name Hidden constructors */
|
---|
50 | //@{
|
---|
51 | DOMNodeList() {};
|
---|
52 | //@}
|
---|
53 |
|
---|
54 | private:
|
---|
55 | // -----------------------------------------------------------------------
|
---|
56 | // Unimplemented constructors and operators
|
---|
57 | // -----------------------------------------------------------------------
|
---|
58 | /** @name Unimplemented constructors and operators */
|
---|
59 | //@{
|
---|
60 | DOMNodeList(const DOMNodeList &);
|
---|
61 | DOMNodeList & operator = (const DOMNodeList &);
|
---|
62 | //@}
|
---|
63 |
|
---|
64 | public:
|
---|
65 | // -----------------------------------------------------------------------
|
---|
66 | // All constructors are hidden, just the destructor is available
|
---|
67 | // -----------------------------------------------------------------------
|
---|
68 | /** @name Destructor */
|
---|
69 | //@{
|
---|
70 | /**
|
---|
71 | * Destructor
|
---|
72 | *
|
---|
73 | */
|
---|
74 | virtual ~DOMNodeList() {};
|
---|
75 | //@}
|
---|
76 |
|
---|
77 | // -----------------------------------------------------------------------
|
---|
78 | // Virtual DOMNodeList interface
|
---|
79 | // -----------------------------------------------------------------------
|
---|
80 | /** @name Functions introduced in DOM Level 1 */
|
---|
81 | //@{
|
---|
82 | // -----------------------------------------------------------------------
|
---|
83 | // Getter methods
|
---|
84 | // -----------------------------------------------------------------------
|
---|
85 | /**
|
---|
86 | * Returns the <code>index</code> item in the collection.
|
---|
87 | *
|
---|
88 | * If <code>index</code> is greater than or equal to the number of nodes in
|
---|
89 | * the list, this returns <code>null</code>.
|
---|
90 | *
|
---|
91 | * @param index Index into the collection.
|
---|
92 | * @return The node at the <code>index</code>th position in the
|
---|
93 | * <code>DOMNodeList</code>, or <code>null</code> if that is not a valid
|
---|
94 | * index.
|
---|
95 | * @since DOM Level 1
|
---|
96 | */
|
---|
97 | virtual DOMNode *item(XMLSize_t index) const = 0;
|
---|
98 |
|
---|
99 | /**
|
---|
100 | * Returns the number of nodes in the list.
|
---|
101 | *
|
---|
102 | * The range of valid child node indices is 0 to <code>length-1</code> inclusive.
|
---|
103 | * @since DOM Level 1
|
---|
104 | */
|
---|
105 | virtual XMLSize_t getLength() const = 0;
|
---|
106 | //@}
|
---|
107 | };
|
---|
108 |
|
---|
109 | XERCES_CPP_NAMESPACE_END
|
---|
110 |
|
---|
111 | #endif
|
---|
112 |
|
---|
113 |
|
---|