2005/5/9

     
 

class ScriptSource

artefaktur
Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members   Related Pages  

acdk::cfgscript::ScriptSource Class Reference

#include <ScriptSource.h>

Inheritance diagram for acdk::cfgscript::ScriptSource:

acdk::lang::Object acdk::io::PushbackCharReader acdk::io::LineNumberCharReader acdk::lang::ObjectBase acdk::lang::dmi::StdDispatch List of all members.

Detailed Description

Source for scripts.


Public Member Functions

 ScriptSource (IN(RString) name, IN(acdk::io::RCharReader) in)
 ScriptSource (IN(RString) name, IN(RString) sourcetext)
 ScriptSource (IN(RString) name, IN(RString) sourcetext, IN(acdk::io::CharStreamPos) sp)
int charPos ()
virtual int getCharPos ()
virtual void setCharPos (int ch)
int getLineNumber ()
void setLineNumber (int lineno)
int getColumnNumber ()
void setColumnNumber (int columnNo)
RString readLine ()
void unread (ucchar ch)
void unread (IN(RString) str)
void resetPushbackBuffer ()
acdk::io::CharStreamPos getSourcePos () const
void setSourcePos (const acdk::io::CharStreamPos &sp)
virtual int readChar ()
 read one char.

virtual RString readString ()
 read until EOF and return as string

virtual void close ()
 closes the reader

virtual acdk::io::RReader getReader (IN(acdk::locale::REncoder) enc=Nil)
 returns the underlying reader

RScriptSource getSourceFragment (IN(acdk::io::CharStreamPos) start, IN(acdk::io::CharStreamPos) end)
acdk::lang::Object clone ()
RString getLine (int line)
 get a line of code, relative to current line 0 return the current line < -1 return lines before current line If line not exists return Nil

int seekCharBack ()
bool isEof ()

Protected Member Functions

void _incrementReaded (IN(RString) str)
bool _getLine (int lineNo, OUT(acdk::io::CharStreamPos) begin, OUT(acdk::io::CharStreamPos) end)
bool _fetchNextLine (int lineNo)
void _setCharPos (int newCharPos)

Private Attributes

RString _sourceName
acdk::io::RCharReader _in
RStringBuffer _buffer
acdk::lang::sys::core_vector<
int > 
_sourcePositions
 each entry is the character position of begining of the line

int _charPos
int _linePos
int _columnPos
bool _eof


Constructor & Destructor Documentation

acdk::cfgscript::ScriptSource::ScriptSource IN(RString name,
IN(acdk::io::RCharReader in
[inline]
 

acdk::cfgscript::ScriptSource::ScriptSource IN(RString name,
IN(RString sourcetext
[inline]
 

acdk::cfgscript::ScriptSource::ScriptSource IN(RString name,
IN(RString sourcetext,
IN(acdk::io::CharStreamPos sp
 


Member Function Documentation

bool acdk::cfgscript::ScriptSource::_fetchNextLine int  lineNo  )  [protected]
 

bool acdk::cfgscript::ScriptSource::_getLine int  lineNo,
OUT(acdk::io::CharStreamPos begin,
OUT(acdk::io::CharStreamPos end
[protected]
 

void acdk::cfgscript::ScriptSource::_incrementReaded IN(RString str  )  [protected]
 

void acdk::cfgscript::ScriptSource::_setCharPos int  newCharPos  )  [protected]
 

int acdk::cfgscript::ScriptSource::charPos  )  [inline]
 

acdk::lang::Object acdk::cfgscript::ScriptSource::clone  )  [inline, virtual]
 

See also:
serialized_clone

Reimplemented from acdk::lang::Object.

virtual void acdk::cfgscript::ScriptSource::close  )  [inline, virtual]
 

closes the reader

Implements acdk::io::LineNumberCharReader.

virtual int acdk::cfgscript::ScriptSource::getCharPos  )  [inline, virtual]
 

Implements acdk::io::LineNumberCharReader.

int acdk::cfgscript::ScriptSource::getColumnNumber  )  [inline, virtual]
 

Implements acdk::io::LineNumberCharReader.

RString acdk::cfgscript::ScriptSource::getLine int  line  ) 
 

get a line of code, relative to current line 0 return the current line < -1 return lines before current line If line not exists return Nil

int acdk::cfgscript::ScriptSource::getLineNumber  )  [inline, virtual]
 

Implements acdk::io::LineNumberCharReader.

virtual acdk::io::RReader acdk::cfgscript::ScriptSource::getReader IN(acdk::locale::REncoder enc = Nil  )  [inline, virtual]
 

returns the underlying reader

Parameters:
encoder uses to write characters. If Nil uses the system encoding

Reimplemented from acdk::io::CharReader.

RScriptSource acdk::cfgscript::ScriptSource::getSourceFragment IN(acdk::io::CharStreamPos start,
IN(acdk::io::CharStreamPos end
[inline]
 

acdk::io::CharStreamPos acdk::cfgscript::ScriptSource::getSourcePos  )  const [inline]
 

bool acdk::cfgscript::ScriptSource::isEof  ) 
 

virtual int acdk::cfgscript::ScriptSource::readChar  )  [virtual]
 

read one char.

Returns:
-1 if end of file

Implements acdk::io::LineNumberCharReader.

RString acdk::cfgscript::ScriptSource::readLine  )  [virtual]
 

Implements acdk::io::LineNumberCharReader.

virtual RString acdk::cfgscript::ScriptSource::readString  )  [virtual]
 

read until EOF and return as string

Implements acdk::io::LineNumberCharReader.

void acdk::cfgscript::ScriptSource::resetPushbackBuffer  )  [virtual]
 

Implements acdk::io::PushbackCharReader.

int acdk::cfgscript::ScriptSource::seekCharBack  ) 
 

virtual void acdk::cfgscript::ScriptSource::setCharPos int  ch  )  [inline, virtual]
 

Implements acdk::io::LineNumberCharReader.

void acdk::cfgscript::ScriptSource::setColumnNumber int  columnNo  )  [inline, virtual]
 

Implements acdk::io::LineNumberCharReader.

void acdk::cfgscript::ScriptSource::setLineNumber int  lineno  )  [inline, virtual]
 

Implements acdk::io::LineNumberCharReader.

void acdk::cfgscript::ScriptSource::setSourcePos const acdk::io::CharStreamPos sp  ) 
 

void acdk::cfgscript::ScriptSource::unread IN(RString str  )  [virtual]
 

Reimplemented from acdk::io::PushbackCharReader.

void acdk::cfgscript::ScriptSource::unread ucchar  ch  )  [virtual]
 

Implements acdk::io::PushbackCharReader.


Member Data Documentation

RStringBuffer acdk::cfgscript::ScriptSource::_buffer [private]
 

int acdk::cfgscript::ScriptSource::_charPos [private]
 

int acdk::cfgscript::ScriptSource::_columnPos [private]
 

bool acdk::cfgscript::ScriptSource::_eof [private]
 

acdk::io::RCharReader acdk::cfgscript::ScriptSource::_in [private]
 

int acdk::cfgscript::ScriptSource::_linePos [private]
 

RString acdk::cfgscript::ScriptSource::_sourceName [private]
 

acdk::lang::sys::core_vector<int> acdk::cfgscript::ScriptSource::_sourcePositions [private]
 

each entry is the character position of begining of the line