1//
2// NodeList.h
3//
4// Library: XML
5// Package: DOM
6// Module: DOM
7//
8// Definition of the DOM NodeList interface.
9//
10// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
11// and Contributors.
12//
13// SPDX-License-Identifier: BSL-1.0
14//
15
16
17#ifndef DOM_NodeList_INCLUDED
18#define DOM_NodeList_INCLUDED
19
20
21#include "Poco/XML/XML.h"
22#include "Poco/DOM/DOMObject.h"
23
24
25namespace Poco {
26namespace XML {
27
28
29class Node;
30
31
32class XML_API NodeList: public DOMObject
33 /// The NodeList interface provides the abstraction of an ordered
34 /// collection of nodes, without defining or constraining how this
35 /// collection is implemented.
36 ///
37 /// The items in the NodeList are accessible via an integral index,
38 /// starting from 0.
39 ///
40 /// A NodeList returned from a method must be released with a call to
41 /// release() when no longer needed.
42{
43public:
44 virtual Node* item(unsigned long index) const = 0;
45 /// Returns the index'th item in the collection. If index is
46 /// greater than or equal to the number of nodes in the list,
47 /// this returns null.
48
49 virtual unsigned long length() const = 0;
50 /// Returns the number of nodes in the list. The range of valid
51 /// node indices is 0 to length - 1 inclusive.
52
53protected:
54 virtual ~NodeList();
55};
56
57
58} } // namespace Poco::XML
59
60
61#endif // DOM_NodeList_INCLUDED
62