source: trunk/src/xmlpatterns/api/qabstractxmlforwarditerator.cpp@ 1168

Last change on this file since 1168 was 846, checked in by Dmitry A. Kuminov, 14 years ago

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

File size: 8.5 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4** All rights reserved.
5** Contact: Nokia Corporation ([email protected])
6**
7** This file is part of the QtXmlPatterns module of the Qt Toolkit.
8**
9** $QT_BEGIN_LICENSE:LGPL$
10** Commercial Usage
11** Licensees holding valid Qt Commercial licenses may use this file in
12** accordance with the Qt Commercial License Agreement provided with the
13** Software or, alternatively, in accordance with the terms contained in
14** a written agreement between you and Nokia.
15**
16** GNU Lesser General Public License Usage
17** Alternatively, this file may be used under the terms of the GNU Lesser
18** General Public License version 2.1 as published by the Free Software
19** Foundation and appearing in the file LICENSE.LGPL included in the
20** packaging of this file. Please review the following information to
21** ensure the GNU Lesser General Public License version 2.1 requirements
22** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23**
24** In addition, as a special exception, Nokia gives you certain additional
25** rights. These rights are described in the Nokia Qt LGPL Exception
26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
27**
28** GNU General Public License Usage
29** Alternatively, this file may be used under the terms of the GNU
30** General Public License version 3.0 as published by the Free Software
31** Foundation and appearing in the file LICENSE.GPL included in the
32** packaging of this file. Please review the following information to
33** ensure the GNU General Public License version 3.0 requirements will be
34** met: http://www.gnu.org/copyleft/gpl.html.
35**
36** If you have questions regarding the use of this file, please contact
37** Nokia at [email protected].
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42/*!
43 \class QAbstractXmlForwardIterator
44 \brief The QAbstractXmlForwardIterator class is a base class for forward iterators.
45 \reentrant
46 \since 4.4
47 \ingroup xml-tools
48 \internal
49
50 This abstract base class is for creating iterators for
51 traversing custom data structures modeled to look like XML.
52 An item can be instantiated in QAbstractXmlForwardIterator if:
53 \list
54
55 \o It has a default constructor, a copy constructor, and an
56 assignment operator, and
57
58 \o It has an appropriate qIsForwardIteratorEnd() function.
59 \endlist
60
61 @ingroup Patternist_iterators
62 @author Frans Englich <[email protected]>
63 */
64
65/*!
66 \typedef QAbstractXmlForwardIterator::Ptr
67
68 A smart pointer wrapping an instance of a QAbstractXmlForwardIterator subclass.
69 */
70
71/*!
72 \typedef QAbstractXmlForwardIterator::List
73 A QList containing QAbstractXmlForwardIterator::Ptr instances.
74 */
75
76/*!
77 \typedef QAbstractXmlForwardIterator::Vector
78 A QVector containing QAbstractXmlForwardIterator::Ptr instances.
79 */
80
81/*!
82 \fn QAbstractXmlForwardIterator::QAbstractXmlForwardIterator()
83
84 Default constructor.
85 */
86
87/*!
88 \fn QAbstractXmlForwardIterator::~QAbstractXmlForwardIterator()
89
90 Destructor.
91 */
92
93/*!
94 \fn T QAbstractXmlForwardIterator::next() = 0;
95
96 Returns the next item in the sequence, or
97 a null object if the end has been reached.
98 */
99
100/*!
101 \fn T QAbstractXmlForwardIterator::current() const = 0;
102
103 Returns the current item in the sequence. If this function is called
104 before the first call to next(), a null object is returned. If the
105 end of the sequence has been reached, a null object is returned.
106 */
107
108/*!
109 \fn qint64 QAbstractXmlForwardIterator::position() const = 0;
110
111 Returns the current position in the sequence represented
112 by \e this.
113
114 The first position is 1, not 0. If next() hasn't been called, 0 is
115 returned. If \e this has reached the end, -1 is returned.
116 */
117
118/*!
119 \fn bool qIsForwardIteratorEnd(const T &unit)
120 \since 4.4
121 \relates QAbstractXmlForwardIterator
122
123 The Callback QAbstractXmlForwardIterator uses for determining
124 whether \a unit is the end of a sequence.
125
126 If \a unit is a value that would signal the end of a sequence
127 (typically a default constructed value), this function returns \c
128 true, otherwise \c false.
129
130 This implementation works for any type that has a boolean operator.
131 For example, this function should work satisfactory for pointers.
132 */
133
134/*!
135 \fn qint64 QAbstractXmlForwardIterator::count()