#include <pd_Iterator.h>
PD_DocIterator::PD_DocIterator | ( | const PD_Document & | doc, | |
PT_DocPosition | dpos = 0 | |||
) |
doc | - the document which we want to iterate | |
dpos | - document position we want to start from |
References _findFrag().
Referenced by makeCopy().
PD_DocIterator::PD_DocIterator | ( | pt_PieceTable & | pt | ) | [inline, private] |
bool PD_DocIterator::_findFrag | ( | ) | [private] |
find the PT fragment that contains current postion (m_pos)
References pf_Fragments::findFirstFragBeforePos(), pt_PieceTable::getFragments(), pf_Frag::getLength(), pf_Frag::getNext(), pf_Frag::getPos(), pf_Frag::getPrev(), m_frag, m_max_pos, m_pos, m_pt, and m_status.
Referenced by operator++(), operator+=(), operator--(), operator-=(), operator[](), PD_DocIterator(), and setPosition().
UT_uint32 PD_DocIterator::find | ( | UT_UCS4Char * | what, | |
UT_uint32 | iLen, | |||
bool | bForward = true | |||
) | [virtual] |
Implements UT_TextIterator.
References getChar(), getPosition(), getStatus(), m_status, UT_return_val_if_fail, and UTIter_OK.
Referenced by PD_Document::findWhereSimilarityResumes().
UT_uint32 PD_DocIterator::find | ( | UT_TextIterator & | text, | |
UT_uint32 | iLen, | |||
bool | bForward = true | |||
) | [virtual] |
UT_UCS4Char PD_DocIterator::getChar | ( | ) | [virtual] |
get character at the curent position
Implements UT_TextIterator.
References pf_Frag_Text::getBufIndex(), pf_Frag::getLength(), pt_PieceTable::getPointer(), pf_Frag::getPos(), pf_Frag::getType(), m_frag, m_pos, m_pt, m_status, UT_ASSERT_HARMLESS, UT_IT_ERROR, UT_return_val_if_fail, UT_SHOULD_NOT_HAPPEN, and UTIter_OK.
Referenced by PD_Document::areDocumentContentsEqual(), find(), PD_Document::findFirstDifferenceInContent(), and operator[]().
const pf_Frag* PD_DocIterator::getFrag | ( | ) | const [inline] |
virtual UT_uint32 PD_DocIterator::getPosition | ( | ) | const [inline, virtual] |
Implements UT_TextIterator.
Referenced by PD_Document::acceptAllRevisions(), PD_Document::acceptRejectRevision(), PD_Document::areDocumentContentsEqual(), PD_Document::areDocumentFormatsEqual(), find(), PD_Document::findFirstDifferenceInContent(), PD_Document::findWhereSimilarityResumes(), and PD_Document::rejectAllHigherRevisions().
virtual UTIterStatus PD_DocIterator::getStatus | ( | ) | const [inline, virtual] |
Implements UT_TextIterator.
Referenced by PD_Document::acceptAllRevisions(), PD_Document::acceptRejectRevision(), PD_Document::areDocumentContentsEqual(), PD_Document::areDocumentFormatsEqual(), find(), PD_Document::findFirstDifferenceInContent(), PD_Document::findWhereSimilarityResumes(), PD_Document::purgeRevisionTable(), and PD_Document::rejectAllHigherRevisions().
virtual UT_uint32 PD_DocIterator::getUpperLimit | ( | ) | const [inline, virtual] |
Implements UT_TextIterator.
UT_TextIterator * PD_DocIterator::makeCopy | ( | ) | const [virtual] |
Implements UT_TextIterator.
References m_frag, m_max_pos, m_pos, m_pt, m_status, PD_DocIterator(), and UT_return_val_if_fail.
UT_TextIterator & PD_DocIterator::operator++ | ( | ) | [virtual] |
various increment operators
Implements UT_TextIterator.
References _findFrag(), m_pos, m_status, and UTIter_OK.
UT_TextIterator & PD_DocIterator::operator+= | ( | UT_sint32 | i | ) | [virtual] |
Implements UT_TextIterator.
References _findFrag(), m_pos, m_status, and UTIter_OK.
UT_TextIterator & PD_DocIterator::operator-- | ( | ) | [virtual] |
Implements UT_TextIterator.
References _findFrag(), m_pos, m_status, and UTIter_OK.
UT_TextIterator & PD_DocIterator::operator-= | ( | UT_sint32 | i | ) | [virtual] |
Implements UT_TextIterator.
References _findFrag(), m_pos, m_status, and UTIter_OK.
UT_UCS4Char PD_DocIterator::operator[] | ( | UT_uint32 | dpos | ) | [virtual] |
advance iterator to document position dpos and return character at that position
Implements UT_TextIterator.
References _findFrag(), getChar(), and m_pos.
void PD_DocIterator::reset | ( | void | ) | [inline] |
void PD_DocIterator::reset | ( | PT_DocPosition | pos, | |
const pf_Frag * | pf | |||
) | [inline] |
void PD_DocIterator::setPosition | ( | UT_uint32 | pos | ) | [virtual] |
Implements UT_TextIterator.
References _findFrag(), and m_pos.
Referenced by PD_Document::findWhereSimilarityResumes().
virtual void PD_DocIterator::setUpperLimit | ( | UT_uint32 | maxpos | ) | [inline, virtual] |
Implements UT_TextIterator.
const pf_Frag* PD_DocIterator::m_frag [private] |
Referenced by _findFrag(), getChar(), and makeCopy().
PT_DocPosition PD_DocIterator::m_max_pos [private] |
Referenced by _findFrag(), and makeCopy().
PT_DocPosition PD_DocIterator::m_pos [private] |
Referenced by _findFrag(), getChar(), makeCopy(), operator++(), operator+=(), operator--(), operator-=(), operator[](), and setPosition().
pt_PieceTable& PD_DocIterator::m_pt [private] |
Referenced by _findFrag(), getChar(), and makeCopy().
UTIterStatus PD_DocIterator::m_status [private] |
Referenced by _findFrag(), find(), getChar(), makeCopy(), operator++(), operator+=(), operator--(), and operator-=().