Qt 4.8
|
Picks out a slice from another QAbstractXmlForwardIterator, specified by a start and end position. More...
#include <qsubsequenceiterator_p.h>
Public Functions | |
virtual Item::Iterator::Ptr | copy () const |
Copies this QAbstractXmlForwardIterator and returns the copy. More... | |
virtual Item | current () const |
Returns the current item in the sequence. More... | |
virtual Item | next () |
Returns the next item in the sequence, or a null object if the end has been reached. More... | |
virtual xsInteger | position () const |
Returns the current position in the sequence represented by this. More... | |
SubsequenceIterator (const Item::Iterator::Ptr &iterator, const xsInteger start, const xsInteger length) | |
Public Functions inherited from QAbstractXmlForwardIterator< T > | |
virtual qint64 | count () |
Determines the number of items this QAbstractXmlForwardIterator represents. More... | |
virtual bool | isEmpty () |
Returns true if the sequence is empty. More... | |
virtual T | last () |
Returns the item at the end of this QAbstractXmlForwardIterator. More... | |
QAbstractXmlForwardIterator () | |
Default constructor. More... | |
virtual qint64 | sizeHint () const |
Gives a hint to the size of the contained sequence. More... | |
virtual QList< T > | toList () |
Performs a copy of this QAbstractXmlForwardIterator(with copy()), and returns its items in a QList. More... | |
virtual QAbstractXmlForwardIterator< T >::Ptr | toReversed () |
Returns a reverse iterator for the sequence. More... | |
virtual | ~QAbstractXmlForwardIterator () |
Destructor. More... | |
Public Functions inherited from QSharedData | |
QSharedData () | |
Constructs a QSharedData object with a reference count of 0. More... | |
QSharedData (const QSharedData &) | |
Constructs a QSharedData object with reference count 0. More... | |
Properties | |
xsInteger | m_counter |
Item | m_current |
const Item::Iterator::Ptr | m_it |
const xsInteger | m_len |
xsInteger | m_position |
const xsInteger | m_start |
const xsInteger | m_stop |
Additional Inherited Members | |
Public Types inherited from QAbstractXmlForwardIterator< T > | |
typedef QList< QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< T > > > | List |
A QList containing QAbstractXmlForwardIterator::Ptr instances. More... | |
typedef QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< T > > | Ptr |
A smart pointer wrapping an instance of a QAbstractXmlForwardIterator subclass. More... | |
typedef QVector< QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< T > > > | Vector |
A QVector containing QAbstractXmlForwardIterator::Ptr instances. More... | |
Public Variables inherited from QSharedData | |
QAtomicInt | ref |
Related Functions inherited from QAbstractXmlForwardIterator< T > | |
template<typename TResult , typename TSource , typename TMapper > | |
static QAbstractXmlForwardIterator< TResult >::Ptr | makeSequenceMappingIterator (const TMapper &mapper, const QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< TSource > > &source, const DynamicContext::Ptr &context) |
An object generator for SequenceMappingIterator. More... | |
bool | qIsForwardIteratorEnd (const T &unit) |
The Callback QAbstractXmlForwardIterator uses for determining whether unit is the end of a sequence. More... | |
Picks out a slice from another QAbstractXmlForwardIterator, specified by a start and end position.
SubsequenceIterator allows a "slice", a subsequence, from an QAbstractXmlForwardIterator to be extracted. The SubsequenceIterator's constructor takes a source QAbstractXmlForwardIterator, a start position, and the length of the subsequence to be extracted.
SubsequenceIterator contains the central business logic to implement the fn:subsequence()
function. The detailed behavior, such as how it behaves if the source QAbstractXmlForwardIterator is empty or if the specified subsequence stretches beyond the source QAbstractXmlForwardIterator, is therefore consistent with the definition of the fn:subsequence()
function.
Definition at line 81 of file qsubsequenceiterator_p.h.
SubsequenceIterator::SubsequenceIterator | ( | const Item::Iterator::Ptr & | iterator, |
const xsInteger | start, | ||
const xsInteger | length | ||
) |
Creates a SubsequenceIterator that extracts a subsequence from the sequence in iterator
, as specified by the start
position and length
parameter.
iterator | the iterator which the subsequence should be extracted from |
start | the start position of extraction. Must be 1 or larger. |
length | the length of the subsequence to extract. If it is -1, to the end is returned. The value must be -1 or 1 or larger. |
Definition at line 50 of file qsubsequenceiterator.cpp.
Referenced by copy().
|
virtual |
Copies this QAbstractXmlForwardIterator and returns the copy.
A copy and the original instance are completely independent of each other. Because evaluating an QAbstractXmlForwardIterator modifies it, one should always use a copy when an QAbstractXmlForwardIterator needs to be used several times.
Reimplemented from QAbstractXmlForwardIterator< T >.
Definition at line 105 of file qsubsequenceiterator.cpp.
|
virtual |
Returns the current item in the sequence.
If this function is called before the first call to next(), a null object is returned. If the end of the sequence has been reached, a null object is returned.
Implements QAbstractXmlForwardIterator< T >.
Definition at line 95 of file qsubsequenceiterator.cpp.
|
virtual |
Returns the next item in the sequence, or a null object if the end has been reached.
Implements QAbstractXmlForwardIterator< T >.
Definition at line 69 of file qsubsequenceiterator.cpp.
|
virtual |
Returns the current position in the sequence represented by this.
The first position is 1, not 0. If next() hasn't been called, 0 is returned. If this has reached the end, -1 is returned.
Implements QAbstractXmlForwardIterator< T >.
Definition at line 100 of file qsubsequenceiterator.cpp.
|
private |
Definition at line 107 of file qsubsequenceiterator_p.h.
Referenced by next().
|
private |
Definition at line 105 of file qsubsequenceiterator_p.h.
|
private |
Definition at line 106 of file qsubsequenceiterator_p.h.
Referenced by copy(), next(), and SubsequenceIterator().
|
private |
Definition at line 109 of file qsubsequenceiterator_p.h.
|
private |
Definition at line 104 of file qsubsequenceiterator_p.h.
Referenced by next(), and position().
|
private |
Definition at line 108 of file qsubsequenceiterator_p.h.
Referenced by copy(), and SubsequenceIterator().
|
private |
Definition at line 110 of file qsubsequenceiterator_p.h.
Referenced by next().