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

OStream Class Reference

Abstract baseclass for output streams. More...

#include <mstream.h>

Inheritance diagram for OStream:

Stream IOStream TextOStream List of all members.

Public Methods

 OStream (String &buffer, int mode=IO_Writable)
 OStream (FILE *strm=stdout)
 OStream (OStream &o)
void flush ()
virtual void copy (const OStream &other)
virtual OStream & printf (const char *format,...)

Detailed Description

Abstract baseclass for output streams.

Definition at line 102 of file mstream.h.


Constructor & Destructor Documentation

OStream String   buffer,
int    mode = IO_Writable
 

Opens a stream attached to the given string buffer.

Example:

        String myBuffer;
        OStream(myBuffer) << "Put some text there " << 123 << 42.42 << '\n';
        OStream(myBuffer, IO_Append) << " Some appended text";
Parameters:
buffer  String buffer to use.
mode  (Optional) opening mode. IO_Writable is always enabled, but IO_Append and IO_Truncate may be very useful.

Definition at line 231 of file mstream.cc.

References IO_Writable.

OStream FILE *    strm = stdout
 

Parameters:
strm  Already opened FILE stream to use.

Definition at line 209 of file mstream.cc.

OStream OStream &    orig
 

Copy constructor.

Definition at line 217 of file mstream.cc.


Member Function Documentation

void copy const OStream &    other [virtual]
 

Standard copy operation.

Definition at line 246 of file mstream.cc.

References Stream::copy(), and mAutoFlush.

void flush  
 

Flush the stream.

Definition at line 239 of file mstream.cc.

References IODevice::flush().

OStream & printf const char *    sformat,
...   
[virtual]
 

Formatted printing to stream.

Note:
The OStream::printf is not very efficient as it prints using a memory buffer. Inheritors should implement it by using device vformat interface.

Reimplemented in TextOStream.

Definition at line 259 of file mstream.cc.

Referenced by Turtle::operator>>().


The documentation for this class was generated from the following files:
Generated on Thu Feb 10 20:06:43 2005 for LibMagiC by doxygen1.2.18