NodeList.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. #ifndef DOM_NodeList_INCLUDED
  16. #define DOM_NodeList_INCLUDED
  17. #include "Poco/XML/XML.h"
  18. #include "Poco/DOM/DOMObject.h"
  19. namespace Poco {
  20. namespace XML {
  21. class Node;
  22. class XML_API NodeList: public DOMObject
  23. /// The NodeList interface provides the abstraction of an ordered
  24. /// collection of nodes, without defining or constraining how this
  25. /// collection is implemented.
  26. ///
  27. /// The items in the NodeList are accessible via an integral index,
  28. /// starting from 0.
  29. ///
  30. /// A NodeList returned from a method must be released with a call to
  31. /// release() when no longer needed.
  32. {
  33. public:
  34. virtual Node* item(unsigned long index) const = 0;
  35. /// Returns the index'th item in the collection. If index is
  36. /// greater than or equal to the number of nodes in the list,
  37. /// this returns null.
  38. virtual unsigned long length() const = 0;
  39. /// Returns the number of nodes in the list. The range of valid
  40. /// node indices is 0 to length - 1 inclusive.
  41. protected:
  42. virtual ~NodeList();
  43. };
  44. } } // namespace Poco::XML
  45. #endif // DOM_NodeList_INCLUDED