Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

lrt::OutputStream Class Reference

OutputStream is the base class for all output streams (such as files opened for writing) in libRT. More...

#include <rtstreams.h>

Inheritance diagram for lrt::OutputStream:

Inheritance graph
[legend]
List of all members.

Public Methods

virtual bool write (int b)=0
 Writes a byte to the output stream. More...

virtual bool write (const Array< char > &b, int off, int len)
 Writes part of an array to the output stream. More...

virtual bool write (const Array< char > &b)
 Writes the whole array b to the output stream. More...

bool write (const char *c)
 Convenience method.

virtual void flush ()
 Advises the system output stream to flush its output buffer. More...

virtual void close ()
 Closes the system output stream. More...

virtual bool fail ()
 Returns true if there was some system failure for this stream (such as, it couldn't be opened).

virtual ~OutputStream ()
 Destroys the output stream. More...


Protected Methods

 OutputStream ()
 Constructs an output stream. More...


Protected Attributes

bool _fail
 Set _fail, if a system-dependent operation for this stream (such as opening) fails.


Detailed Description

OutputStream is the base class for all output streams (such as files opened for writing) in libRT.

Since this abstract OutputStream does not implement any data destination, it is impossible to construct one. For concrete OutputStreams, look at:

See also:
FileOutputStream


Constructor & Destructor Documentation

lrt::OutputStream::~OutputStream (    )  [virtual]
 

Destroys the output stream.

The destructor of class OutputStream just calls the close() method.

lrt::OutputStream::OutputStream (    )  [protected]
 

Constructs an output stream.

The constructor of class OutputStream just does nothing and is only present to avoid construction of plain OutputStreams.


Member Function Documentation

void lrt::OutputStream::close (    )  [virtual]
 

Closes the system output stream.

Note that closed streams cannot be re-opened.

Reimplemented in lrt::NetworkOutputStream.

void lrt::OutputStream::flush (    )  [virtual]
 

Advises the system output stream to flush its output buffer.

The flush() method of OutputStream does nothing.

Reimplemented in lrt::FileOutputStream.

bool lrt::OutputStream::write (  const Array< char > &    b )  [virtual]
 

Writes the whole array b to the output stream.

Since String is derived from Array<char> in libRT, you may also use this method to write Strings to the output stream.

Returns:
Whether writing the array succeeded.

Reimplemented in lrt::NetworkOutputStream.

bool lrt::OutputStream::write (  const Array< char > &    b,
int    off,
int    len
)  [virtual]
 

Writes part of an array to the output stream.

Returns:
Whether writing succeeded.

Reimplemented in lrt::NetworkOutputStream.

virtual bool lrt::OutputStream::write (  int    b )  [pure virtual]
 

Writes a byte to the output stream.

Subclassers must implement this method.

Returns:
Whether writing succeeded.

Implemented in lrt::NetworkOutputStream.


The documentation for this class was generated from the following files:
This is the RoboTour API documentation version 0.1 • Copyright (C) by Florian Fischer