fe::ITextIterator Class Reference
[Ferry Core library]

Iterator over editor's text. More...

Inheritance diagram for fe::ITextIterator:

fe::CachingTextIterator fe::TextIteratorProxy

List of all members.

Public Types

enum  { npos = (unsigned)-1 }

Public Member Functions

virtual unsigned UC_DLL_CALL getCurByteIdx () const =0
virtual unsigned UC_DLL_CALL getCurLineFirstByteIdx () const =0
virtual unsigned UC_DLL_CALL getCurLineIdx () const =0
String getCurLineText () const
String gotoByte (unsigned byteIdx)
String gotoLine (unsigned lineIdx)
String nextLine ()
String prevLine ()

Protected Member Functions

virtual void UC_DLL_CALL getCurLineTextImpl (String &res) const =0
virtual void UC_DLL_CALL gotoByteImpl (unsigned byteIdx, String &res)=0
virtual void UC_DLL_CALL gotoLineImpl (unsigned lineIdx, String &res)=0
virtual void UC_DLL_CALL nextLineImpl (String &res)=0
virtual void UC_DLL_CALL prevLineImpl (String &res)=0


Detailed Description

Iterator over editor's text.

Iterator can be in two states: valid and invalid.

When iterator is in valid state it points to some existing text position otherwise it is in invalid state.

Only non constant fe::ITextIterator methods can change state of an iterator.

If iterator is in invalid state all fe::ITextIterator methods with unsigned return type return npos and all methods with String return type return String{ptr: 0; len: -1} value.

Note:
This class is declared with UC_DLL_INTERFACE_DECLARE
See also:
fe::IEditorFacade::createTextIterator()

Member Enumeration Documentation

anonymous enum

Enumerator:
npos 


Member Function Documentation

virtual void UC_DLL_CALL fe::ITextIterator::getCurLineTextImpl ( String res  )  const [protected, pure virtual]

virtual void UC_DLL_CALL fe::ITextIterator::gotoLineImpl ( unsigned  lineIdx,
String res 
) [protected, pure virtual]

virtual void UC_DLL_CALL fe::ITextIterator::gotoByteImpl ( unsigned  byteIdx,
String res 
) [protected, pure virtual]

virtual void UC_DLL_CALL fe::ITextIterator::nextLineImpl ( String res  )  [protected, pure virtual]

virtual void UC_DLL_CALL fe::ITextIterator::prevLineImpl ( String res  )  [protected, pure virtual]

String fe::ITextIterator::getCurLineText (  )  const [inline]

Returns contents of the text line to which the text position pointed by this iterator belongs.

Note:
Return value is valid until on of gotoLine(), gotoByte(), nextLine() or prevLine() methods is called on this iterator.

virtual unsigned UC_DLL_CALL fe::ITextIterator::getCurLineIdx (  )  const [pure virtual]

Returns index of a text line to which the text position pointed by this iterator belongs.

Implemented in fe::CachingTextIterator, and fe::TextIteratorProxy.

virtual unsigned UC_DLL_CALL fe::ITextIterator::getCurByteIdx (  )  const [pure virtual]

Returns text position pointed by this iterator.

Implemented in fe::CachingTextIterator, and fe::TextIteratorProxy.

virtual unsigned UC_DLL_CALL fe::ITextIterator::getCurLineFirstByteIdx (  )  const [pure virtual]

Returns position of the first byte of a text line to which the text position pointed by this iterator belongs.

Implemented in fe::CachingTextIterator, and fe::TextIteratorProxy.

String fe::ITextIterator::gotoLine ( unsigned  lineIdx  )  [inline]

Moves this iterator to the first byte of a text line with the given index.

Note:
Return value is valid until on of gotoLine(), gotoByte(), nextLine() or prevLine() methods is called on this iterator.
Parameters:
lineIdx index of the line which first byte should be pointed by the iterator
Returns:
contents of the text line to which the new text position pointed by this iterator belongs

String fe::ITextIterator::gotoByte ( unsigned  byteIdx  )  [inline]

Moves this iterator to the given position in the text.

Note:
Return value is valid until on of gotoLine(), gotoByte(), nextLine() or prevLine() methods is called on this iterator.
Parameters:
byteIdx text position this iterator should move to
Returns:
contents of the text line to which the new text position pointed by this iterator belongs

String fe::ITextIterator::nextLine (  )  [inline]

Moves this iterator to the first byte of the text line following the text line to which the text position pointed by this iterator belongs.

Note:
Return value is valid until on of gotoLine(), gotoByte(), nextLine() or prevLine() methods is called on this iterator.
Returns:
contents of the text line to which the new text position pointed by this iterator belongs

String fe::ITextIterator::prevLine (  )  [inline]

Moves this iterator to the first byte of the text line preceding the text line to which the text position pointed by this iterator belongs.

Note:
Return value is valid until on of gotoLine(), gotoByte(), nextLine() or prevLine() methods is called on this iterator.
Returns:
contents of the text line to which the new text position pointed by this iterator belongs


The documentation for this class was generated from the following file:

Generated on Tue Nov 18 21:08:23 2008 for Ferry by doxygen 1.5.7.1
http://sourceforge.net