Falcon::StreamBuffer Class Reference

Buffered version of basic stream. More...

#include <streambuffer.h>

Inheritance diagram for Falcon::StreamBuffer:

Inheritance graph
[legend]

List of all members.

Public Types

enum  { default_buffer_size = 4096 }

Public Member Functions

uint32 bufferSize () const
virtual FalconDataclone () const
 Clones the stream.
virtual bool close ()
 Close target stream.
void detach ()
 Disengages this transcoder from the underlying stream.
virtual bool errorDescription (::Falcon::String &description) const
virtual bool flush ()
 Flushes stream buffers.
virtual bool get (uint32 &chr)
 Gets next character from the stream.
virtual bool isStreamBuffer () const
virtual int64 lastError () const
virtual bool put (uint32 chr)
 Writes a character on the stream.
virtual int32 read (void *buffer, int32 size)
 Reads from target stream.
virtual int32 readAvailable (int32 msecs_timeout, const Sys::SystemData *sysData=0)
 Determines if the stream can be read, possibly with a given timeout.
bool resizeBuffer (uint32 size)
virtual t_status status () const
 StreamBuffer (const StreamBuffer &other)
 StreamBuffer (Stream *underlying, bool bOwn=true, uint32 bufSize=default_buffer_size)
virtual int64 tell ()
virtual bool truncate (int64 pos=-1)
Streamunderlying () const
 Returns the underlying stream used by this transcoder.
virtual int32 write (const void *buffer, int32 size)
 Write to the target stream.
virtual int32 writeAvailable (int32 msecs_timeout, const Sys::SystemData *sysData)
 Determines if the stream can be written, possibly with a given timeout.
virtual ~StreamBuffer ()

Public Attributes

enum Falcon::StreamBuffer:: { ... }  enum_default_buffer_size

Protected Member Functions

virtual int64 seek (int64 pos, e_whence whence)


Detailed Description

Buffered version of basic stream.

Everything except reading straight is to be tested.


Member Enumeration Documentation

anonymous enum

Enumerator:
default_buffer_size 


Constructor & Destructor Documentation

Falcon::StreamBuffer::StreamBuffer ( Stream underlying,
bool  bOwn = true,
uint32  bufSize = default_buffer_size 
)

Falcon::StreamBuffer::StreamBuffer ( const StreamBuffer other  ) 

virtual Falcon::StreamBuffer::~StreamBuffer (  )  [virtual]


Member Function Documentation

uint32 Falcon::StreamBuffer::bufferSize (  )  const [inline]

virtual FalconData* Falcon::StreamBuffer::clone (  )  const [virtual]

Clones the stream.

This version returns 0 and sets error to unsupported; subclasses must properly clone the stream.

Reimplemented from Falcon::Stream.

virtual bool Falcon::StreamBuffer::close (  )  [virtual]

Close target stream.

Reimplemented from Falcon::Stream.

void Falcon::StreamBuffer::detach (  )  [inline]

Disengages this transcoder from the underlying stream.

virtual bool Falcon::StreamBuffer::errorDescription ( ::Falcon::String description  )  const [inline, virtual]

Reimplemented from Falcon::Stream.

virtual bool Falcon::StreamBuffer::flush (  )  [virtual]

Flushes stream buffers.

Hook for buffered streams.

Reimplemented from Falcon::Stream.

virtual bool Falcon::StreamBuffer::get ( uint32 chr  )  [virtual]

Gets next character from the stream.

Subclasses must manage both stateful transcoding and properly popping readahead characters from the buffer.

Returns:
true if the character is available, false on stream end or error.

Implements Falcon::Stream.

virtual bool Falcon::StreamBuffer::isStreamBuffer (  )  const [inline, virtual]

Reimplemented from Falcon::Stream.

virtual int64 Falcon::StreamBuffer::lastError (  )  const [inline, virtual]

Reimplemented from Falcon::Stream.

virtual bool Falcon::StreamBuffer::put ( uint32  chr  )  [virtual]

Writes a character on the stream.

Parameters:
chr the character to write.
Returns:
true success, false on stream error.

Reimplemented from Falcon::Stream.

virtual int32 Falcon::StreamBuffer::read ( void *  buffer,
int32  size 
) [virtual]

Reads from target stream.

Parameters:
buffer the buffer where read data will be stored.
size the amount of bytes to read

Reimplemented from Falcon::Stream.

virtual int32 Falcon::StreamBuffer::readAvailable ( int32  msecs_timeout,
const Sys::SystemData sysData = 0 
) [virtual]

Determines if the stream can be read, possibly with a given timeout.

If sysData is not zero, it will be used to honor concurrent interrupt requests.

Reimplemented from Falcon::Stream.

bool Falcon::StreamBuffer::resizeBuffer ( uint32  size  ) 

virtual int64 Falcon::StreamBuffer::seek ( int64  pos,
e_whence  whence 
) [protected, virtual]

Reimplemented from Falcon::Stream.

virtual t_status Falcon::StreamBuffer::status (  )  const [inline, virtual]

Reimplemented from Falcon::Stream.

virtual int64 Falcon::StreamBuffer::tell (  )  [virtual]

Reimplemented from Falcon::Stream.

virtual bool Falcon::StreamBuffer::truncate ( int64  pos = -1  )  [virtual]

Reimplemented from Falcon::Stream.

Stream* Falcon::StreamBuffer::underlying (  )  const [inline]

Returns the underlying stream used by this transcoder.

Returns:
the underlying stream.

virtual int32 Falcon::StreamBuffer::write ( const void *  buffer,
int32  size 
) [virtual]

Write to the target stream.

Reimplemented from Falcon::Stream.

virtual int32 Falcon::StreamBuffer::writeAvailable ( int32  msecs_timeout,
const Sys::SystemData sysData 
) [virtual]

Determines if the stream can be written, possibly with a given timeout.

If sysData is not zero, it will be used to honor concurrent interrupt requests.

Reimplemented from Falcon::Stream.


Member Data Documentation


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

Generated on Mon Oct 19 10:11:46 2009 for Falcon_Core by  doxygen 1.5.8