2005/5/9

     
 

class ConsoleReader

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

acdk::io::ConsoleReader Class Reference

#include <ConsoleReader.h>

Inheritance diagram for acdk::io::ConsoleReader:

acdk::io::AbstractStorageReader acdk::io::AbstractReader acdk::io::Storage acdk::lang::Object acdk::io::Reader acdk::lang::ObjectBase acdk::lang::dmi::StdDispatch List of all members.

Detailed Description

Read bytes from a console (standard input) API: ACDK

Author:
Roger Rene Kommer (mailto:kommer@artefaktur.com)
Version:
Revision
1.17
Date:
Date
2005/04/09 19:26:44


Public Member Functions

 ConsoleReader (InChannel fd=InvalidInChannel)
virtual jlong seek (SeekPos seekrel, jlong seekpos)
 Set stream position in this Reader to given position.

virtual int read ()
 read a single byte from stream

virtual int unread (byte ch)
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)
virtual void reset ()
 if mark is set, set stream to mark point otherwise to begin of this stream.

virtual bool ready ()
virtual RString getDeviceName ()
virtual bool isReadable ()
virtual bool isWriteable ()

Private Attributes

int _last
RFileDescriptor _fd
bool _eof


Constructor & Destructor Documentation

acdk::io::ConsoleReader::ConsoleReader InChannel  fd = InvalidInChannel  ) 
 


Member Function Documentation

virtual RString acdk::io::ConsoleReader::getDeviceName  )  [virtual]
 

Returns:
the name of the device. Normally the filename

Implements acdk::io::AbstractStorageReader.

virtual bool acdk::io::ConsoleReader::isReadable  )  [inline, virtual]
 

Returns:
true if Storage is readable

Implements acdk::io::AbstractStorageReader.

virtual bool acdk::io::ConsoleReader::isWriteable  )  [inline, virtual]
 

Returns:
true if Storage is writable

Implements acdk::io::AbstractStorageReader.

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

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

Reimplemented from acdk::io::AbstractReader.

virtual int acdk::io::ConsoleReader::read IN(RbyteArray buffer,
int  offset = 0,
int  len = -1
[inline, 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::AbstractReader.

virtual int acdk::io::ConsoleReader::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::AbstractReader.

virtual bool acdk::io::ConsoleReader::ready  )  [virtual]
 

Returns:
true, if at least 1 byte can be readed from stream

Reimplemented from acdk::io::Reader.

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

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

Implements acdk::io::AbstractReader.

virtual jlong acdk::io::ConsoleReader::seek SeekPos  seekrel,
jlong  seekpos
[virtual]
 

Set stream position in this Reader to given position.

Returns:
the absolute position in this stream

Reimplemented from acdk::io::AbstractReader.

virtual int acdk::io::ConsoleReader::unread byte  ch  )  [virtual]
 


Member Data Documentation

bool acdk::io::ConsoleReader::_eof [private]
 

RFileDescriptor acdk::io::ConsoleReader::_fd [private]
 

int acdk::io::ConsoleReader::_last [private]