Developer Documentation
RAVL, Recognition And Vision Library
USER HOME PAGE CLASS LIST CONTENTS
Ravl - OS - Text Processing - TextCursorC
 

  PUBLIC
TextCursorC::TextCursorC(void)
TextCursorC::TextCursorC(TextFileC &)
TextCursorC::TextCursorC(TextBufferC &)
TextCursorC::TextCursorC(const StringC &)
TextCursorC::TextCursorC(TextFileC &,DLIterC,int)
TextCursorC::TextCursorC(TextBufferC &,DLIterC,int)
TextCursorC::TextCursorC(const TextCursorC &)
TextCursorC::Goto(UIntT,UIntT)
TextCursorC::LineNo(void) const
TextCursorC::GotoCol(UIntT)
TextCursorC::Insert(StringC,bool)
TextCursorC::InsertLine(StringC)
TextCursorC::InsertLineBefore(StringC)
TextCursorC::Clip(const Regex &)
TextCursorC::ClipWordInc(const SArray1dC &)
TextCursorC::ClipID(void)
TextCursorC::ClipWord(const SArray1dC &,bool)
TextCursorC::BuildClipTable(const char *)
TextCursorC::ClipWord(const char *,bool)
TextCursorC::ClipTo(const StringC &,bool)
TextCursorC::Skip(const Regex &)
TextCursorC::Skip(const StringC &)
TextCursorC::SkipTo(const StringC &)
TextCursorC::Skip(const char *)
TextCursorC::SkipChars(const char *)
TextCursorC::SkipChars(const SArray1dC &)
TextCursorC::SkipWhite(void)
TextCursorC::IsElm(void) const
TextCursorC::LineText(void)
TextCursorC::LineText(void) const
TextCursorC::RestOfLine(void)
TextCursorC::Char(void)
TextCursorC::NextChar(void)
TextCursorC::PrevChar(void)
TextCursorC::NextLine(void)
TextCursorC::PrevLine(void)
TextCursorC::First(void)
TextCursorC::FirstLine(void)
TextCursorC::LastLine(void)
TextCursorC::BeginLine(void)
TextCursorC::EndOfBuffer(void)
TextCursorC::TextFile(void)
TextCursorC::TextFile(void) const
TextCursorC::ColNum(void) const
TextCursorC::PositionTxt(void)

   TextCursorC   
 
Cursor in text buffer.
 
include "Ravl/Text/TextCursor.hh"
Created:5/8/97 
Source file:Ravl/OS/Text/TextCursor.hh
User Level:Normal
Library:RavlOS
In Scope:RavlN

Comments:
This is a SMALL object.

Variables:
DLIterC line;
Ptr to current line.

UIntT Col;
Col 0 to n.

TextFileC textbuff;
Buffer we're working with.

Methods:
TextCursorC()
Default constructor.

TextCursorC(TextFileC & file)
Constructor.

TextCursorC(TextBufferC & file)
Constructor.

TextCursorC(const StringC & file)
Constructor.

TextCursorC(TextFileC & file,DLIterC<TextFileLineC> AtLine,int ncol = 0)
Constructor.

TextCursorC(TextBufferC & buff,DLIterC<TextFileLineC> AtLine,int ncol = 0)
Constructor.

TextCursorC(const TextCursorC & oth)
Copy constructor.

bool Goto(UIntT lineNo,UIntT charNo = 0)
Goto a specific line/char.

UIntT LineNo() const
Get the current lineno.

bool GotoCol(UIntT col)
Goto a specific char on current line.

bool Insert(StringC txt,bool leaveAtEnd = false)
Insert text after character indicated by the cursor.
If 'leaveAtEnd' is true the cursor is left after the inserted text, otherwise the cursor isn't changed. Returns true on success.

bool InsertLine(StringC txt)
Insert line of text on line after cursor.

bool InsertLineBefore(StringC txt)
Insert line of text on line before cursor.

StringC Clip(const Regex & exp)
Clip out a substring from the current line.
leave the cursor positioned after the text that was returend. NB. Buffer is not changed !

StringC ClipWordInc(const SArray1dC<bool> & table)
Clip out a string of characters included in 'table'.
leave the cursor positioned after the text that was returend. NB. Buffer is not changed !

StringC ClipID()
Clip out a identifier from line.
This follows the usual 'C' type rules. In Regex language: "[A-Za-z_][A-Za-z0-9_]*". leave the cursor positioned after the text that was returend. NB. Buffer is not changed !

SubStringC ClipWord(const SArray1dC<bool> & table,bool initalSkipDelim = true)
Clip out string deliminated by delim characters.
table has 256 elements one for each character. true means its a delim.

Effectively does a SkipWhite(), the Clip("[^ ]*");

leave the cursor positioned after the text that was returend. NB. Buffer is not changed !

Only if initalSkipDelim is true, deliminators at the begining of the string will be skiped.


static SArray1dC<bool> BuildClipTable(const char * delim)
Build a clip table suitable for above.

SubStringC ClipWord(const char * delim = " \n\t\r\0",bool initalSkipDelim = true)
Clip out string deliminated by delim characters.
Effectively does a SkipWhite(), the Clip("[^ ]*");

leave the cursor positioned after the text that was returend. NB. Buffer is not changed !

Only if initalSkipDelim is true, deliminators at the begining of the string will be skiped.


StringC ClipTo(const StringC & text,bool orToEOF = false)
Clip all text in file from the cursor to text.
if 'text' is not found in the file an empty string is returned. the iterator is left after the found 'text'. NB. In the current implementation 'text' may not contain a carrage return unless its the last character in the string.

bool Skip(const Regex & exp)
Skip the text described by exp.
Returns True if expression was matched.

bool Skip(const StringC & text)
Skip a fixed string.
Returns True if the text was found. if not returns false, and leaves iterator unchanged.

bool SkipTo(const StringC & text)
Skip to the next occurance of a string.
Returns true if the text has been found, false otherwise. if the string is not found the iterator is left unchanged, otherwise its is left on the character after 'text'.

NB. In the current implementation 'text' may not contain a carrage return unless its the last character in the string.


bool Skip(const char * text)
Skip a fixed string.
Returns True if the strip was found. if not returns false, and leaves iterator unchanged.

bool SkipChars(const char * delim)
Skip all characters in delim
Returns True if left at a valid place.

bool SkipChars(const SArray1dC<bool> & table)
Skip all characters in table.
the table can be created by BuildClipTable. Returns True if left at a valid place.

bool SkipWhite()
Skip white spaces, including carrage return.

bool IsElm() const
Is on valid line.

StringC & LineText()
Text on current line.

const StringC & LineText() const
Text on current line.

SubStringC RestOfLine()
Get the rest of the current line.

char & Char()
Get character.

bool NextChar()
Goto next character in buffer.

bool PrevChar()
Goto previous character in buffer.

bool NextLine()
Goto next line.

void PrevLine()
Goto previous line.

void First()
Goto the first columb of the first line in the file.

void FirstLine()
Goto the first line in the file.

void LastLine()
Goto last line in the file

void BeginLine()
Goto begining of line.

void EndOfBuffer()
Goto the end of the buffer.

TextFileC & TextFile()
Get text file.

const TextFileC & TextFile() const
Get text file.

UIntT ColNum() const
Get the current columb number.

StringC PositionTxt()
Print out position in human readable sytle.


Maintainer:Charles Galambos, Created: 5/8/97, Documentation by CxxDoc: Tue Aug 13 09:59:30 2002