Qt 4.8
|
Removes one items at a specified position from an input QAbstractXmlForwardIterator. More...
#include <qremovaliterator_p.h>
Public Functions | |
virtual Item::Iterator::Ptr | copy () const |
Copies this QAbstractXmlForwardIterator and returns the copy. More... | |
virtual xsInteger | count () |
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... | |
RemovalIterator (const Item::Iterator::Ptr &target, const xsInteger position) | |
Public Functions inherited from QAbstractXmlForwardIterator< Item > | |
virtual bool | isEmpty () |
Returns true if the sequence is empty. More... | |
virtual Item | 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< Item > | toList () |
Performs a copy of this QAbstractXmlForwardIterator(with copy()), and returns its items in a QList. More... | |
virtual QAbstractXmlForwardIterator< Item >::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 | |
Item | m_current |
xsInteger | m_position |
const xsInteger | m_removalPos |
const Item::Iterator::Ptr | m_target |
Removes one items at a specified position from an input QAbstractXmlForwardIterator.
RemoveIterator removes an item from a sequence at a certain position, while retaining the pull-based characteristic of being an QAbstractXmlForwardIterator itself. The RemovalIterator's constructor is passed an QAbstractXmlForwardIterator, the QAbstractXmlForwardIterator to remove from, and the position of the item to remove. When calling the RemovalIterator's functions, it acts as an ordinary QAbstractXmlForwardIterator, taking into account that one item is removed from the source QAbstractXmlForwardIterator.
The RemovalIterator class contains the central business logic for implementing the fn:remove()
function, whose definition therefore specifies the detailed behaviors of RemovalIterator.
Definition at line 83 of file qremovaliterator_p.h.
RemovalIterator::RemovalIterator | ( | const Item::Iterator::Ptr & | target, |
const xsInteger | position | ||
) |
Creates an RemovalIterator.
target | the QAbstractXmlForwardIterator containing the sequence of items which the item at position position should be removed from. |
position | the position of the item to remove. Must be 1 or larger. |
Definition at line 49 of file qremovaliterator.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< Item >.
Definition at line 104 of file qremovaliterator.cpp.
|
virtual |
The QAbstractXmlForwardIterator's count is computed by subtracting one from the source QAbstractXmlForwardIterator's count.
Reimplemented from QAbstractXmlForwardIterator< Item >.
Definition at line 84 of file qremovaliterator.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< Item >.
Definition at line 94 of file qremovaliterator.cpp.
|
virtual |
Returns the next item in the sequence, or a null object if the end has been reached.
Implements QAbstractXmlForwardIterator< Item >.
Definition at line 58 of file qremovaliterator.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< Item >.
Definition at line 99 of file qremovaliterator.cpp.
|
private |
Definition at line 113 of file qremovaliterator_p.h.
|
private |
Definition at line 114 of file qremovaliterator_p.h.
Referenced by next(), and position().
|
private |
Definition at line 112 of file qremovaliterator_p.h.
|
private |
Definition at line 111 of file qremovaliterator_p.h.