#include
<sxiterator.h>
Collaboration diagram for sx360::sxIterator:
Public Member Functions |
|
sxIterator (sxPunchFile *pf, ByteMap *bmap) | |
virtual | ~sxIterator () |
int | getCurrentIndex () const |
sxRecord * | first () |
sxRecord * | last () |
sxRecord * | next () |
sxRecord * | previous () |
bool | write () |
sxRecord * | gotoRecord (size_t i) |
sxRecord * | gotoRecord (sxIndex *idx, size_t i) |
Public Attributes |
|
sxEvent * | recordChangeEvent |
sxIterator::sxIterator | ( | sxPunchFile * | pf, | |
ByteMap * | bmap | |||
) |
Constructor called by the sxPunchFile when the file is opened in READ_ONLY or READ_WRITE mode.
sxIterator::~sxIterator | ( | |
) | [virtual] |
Destructor
int sxIterator::getCurrentIndex | ( | |
) | const |
Returns the 0 based index of the current sxRecord.
sxRecord * sxIterator::first | ( | |
) |
Moves to the first record in the file. Returns NULL if not valid.
sxRecord * sxIterator::last | ( | |
) |
Moves to the last record in the file. Returns NULL if not valid.
sxRecord * sxIterator::next | ( | |
) |
Moves to the next record in the file. Returns NULL if not valid.
sxRecord * sxIterator::previous | ( | |
) |
Moves to the previous record in the file. Returns NULL if not valid.
bool sxIterator::write | ( | |
) |
Writes the current record to the file only if the file was open in READ_WRITE mode. Returns whether the write was successful.
sxRecord * sxIterator::gotoRecord | ( | size_t | i | ) |
Moves to the 0 based record specified by i. Returns NULL if not valid.
Moves to a record id using an index. Returns an sxRecord if found or
NULL if not found.
sxIndex* idx = the index for searching
size_t i = the id of the record that is being searched. This is in
contrast to the above implmentation that is the 0 based index of the
record being searched.
Assign a sxEvent to this member to have a custom function executed
whenever the sxIterator moves off of the current record. See the
documentation for sxEvent for more detail on usage.