2005/5/9

     
 

class LineNumberReader

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

acdk::io::LineNumberReader Class Reference

#include <LineNumberReader.h>

Inheritance diagram for acdk::io::LineNumberReader:

acdk::io::AbstractFilterReader acdk::io::AbstractReader acdk::io::FilterReader acdk::lang::Object acdk::io::Reader acdk::lang::ObjectBase acdk::lang::dmi::StdDispatch List of all members.

Detailed Description

A filter reader provides information about line and column of current read position.

See also:
acdk::io::LineNumberCharReader for character based LineNumberReader
Author:
Roger Rene Kommer (mailto:kommer@artefaktur.com)
Version:
Revision
1.15
Date:
Date
2005/04/09 19:26:45


Public Member Functions

 LineNumberReader (IN(RReader) in, IN(acdk::lang::Object) lock=Nil)
virtual int getLineNumber ()
 return the line number of current read position

virtual void setLineNumber (int ln)
virtual void mark (int readlimit)
virtual void reset ()
 if mark is set, set stream to mark point otherwise to begin of this stream.

virtual int read ()
 read a single byte from stream

virtual int read (IN(RbyteArray) buffer, int offset=0, int len=-1)
 read the len bytes into buffer at offset of the buffer

virtual int read (byte *buffer, int offset, int len)
int getXPos ()
 return the column position

int getBytePos ()
 provides information of current readed byte position


Protected Attributes

int _charPos
int _markedCharPos
int _lineNumber
int _markedLineNumber
int _xPos
int _markedXPos
byte _eof
 0 not eof, 1 at eof 2 behind eof


Private Member Functions

int _read ()


Constructor & Destructor Documentation

acdk::io::LineNumberReader::LineNumberReader IN(RReader in,
IN(acdk::lang::Object lock = Nil
 


Member Function Documentation

int acdk::io::LineNumberReader::_read  )  [private]
 

int acdk::io::LineNumberReader::getBytePos  )  [inline]
 

provides information of current readed byte position

virtual int acdk::io::LineNumberReader::getLineNumber  )  [inline, virtual]
 

return the line number of current read position

int acdk::io::LineNumberReader::getXPos  )  [inline]
 

return the column position

virtual void acdk::io::LineNumberReader::mark int  readlimit  )  [virtual]
 

Reimplemented from acdk::io::AbstractFilterReader.

virtual int acdk::io::LineNumberReader::read byte buffer,
int  offset,
int  len
[inline, virtual]
 

See also:
other read(RbyteArray, int, int)

Reimplemented from acdk::io::AbstractFilterReader.

virtual int acdk::io::LineNumberReader::read IN(RbyteArray buffer,
int  offset = 0,
int  len = -1
[virtual]
 

read the len bytes into buffer at offset of the buffer

Parameters:
buffer where to write the bytes
offset offset to write into buffer
len how many bytes to read. if == -1 read into many bytes, that fits into buffer (buffer->length() - offset) ``
Returns:
number of bytes readed. may less than input if EOS is reached
Exceptions:
EOF exception, if trying to read behind EOS

Reimplemented from acdk::io::AbstractFilterReader.

virtual int acdk::io::LineNumberReader::read  )  [virtual]
 

read a single byte from stream

Returns:
the byte readed or -1 if EOS.
Exceptions:
EOF exception, if trying to read behind EOS

Reimplemented from acdk::io::AbstractFilterReader.

virtual void acdk::io::LineNumberReader::reset  )  [virtual]
 

if mark is set, set stream to mark point otherwise to begin of this stream.

Reimplemented from acdk::io::AbstractFilterReader.

virtual void acdk::io::LineNumberReader::setLineNumber int  ln  )  [inline, virtual]
 


Member Data Documentation

int acdk::io::LineNumberReader::_charPos [protected]
 

byte acdk::io::LineNumberReader::_eof [protected]
 

0 not eof, 1 at eof 2 behind eof

int acdk::io::LineNumberReader::_lineNumber [protected]
 

int acdk::io::LineNumberReader::_markedCharPos [protected]
 

int acdk::io::LineNumberReader::_markedLineNumber [protected]
 

int acdk::io::LineNumberReader::_markedXPos [protected]
 

int acdk::io::LineNumberReader::_xPos [protected]