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

Stream Class Reference

Abstract streams baseclass. More...

#include <mstream.h>

Inheritance diagram for Stream:

IStream OStream DataIStream IOStream TextIStream IOStream TextOStream List of all members.

Public Types

enum  Encoding

Public Methods

 Stream (IODevice &dev)
 Stream (IODevice *dev)
 Stream (String &buffer)
 Stream (FILE *strm)
 Stream (Stream &orig)
virtual ~Stream ()
void setDevice (IODevice *dev)
virtual void copy (const Stream &other)

Protected Attributes

bool mOwnDevice
int mFormatMode
Encoding mEncoding
ulong mFlags

Detailed Description

Abstract streams baseclass.

All streams always have an associated device, the type of which can vary.

Definition at line 51 of file mstream.h.


Member Enumeration Documentation

enum Encoding
 

Defines the character encoding of the stream.

Definition at line 62 of file mstream.h.


Constructor & Destructor Documentation

Stream IODevice   dev
 

Constructor from a reference to a device.

Because the device was given with a reference, the stream object does not take the ownership of the device object and therefore does not destroy it along with itself.

Definition at line 71 of file mstream.cc.

References mFormatMode, and mOwnDevice.

Stream IODevice   dev
 

Constructor from a pointer to a device.

Because the device was given with a pointer, the stream object takes the ownership of the device object and destroys it along with itself.

Definition at line 82 of file mstream.cc.

References mFormatMode, and mOwnDevice.

Stream String   buffer
 

Shorthand constructor for a buffer device.

The IODevice object is handled internally. The stream object keeps the ownership of the device object and destroys it along with itself.

Definition at line 94 of file mstream.cc.

References mFormatMode, and mOwnDevice.

Stream FILE *    strm
 

Shorthand constructor for a file device.

The IODevice object is handled internally. The stream object keeps the ownership of the device object and destroys it along with itself.

Definition at line 106 of file mstream.cc.

References mFormatMode, and mOwnDevice.

Stream Stream &    orig
 

Copy constructor.

Definition at line 115 of file mstream.cc.

References IODevice::addStream(), mEncoding, mFlags, mFormatMode, mOwnDevice, and mpDevice.

~Stream   [virtual]
 

Destructor for the stream.

The associated device is destructed along with the stream, unless passed with a reference.

Definition at line 132 of file mstream.cc.


Member Function Documentation

void copy const Stream &    other [virtual]
 

Copy operator.

Warning: Does not take ownership of the device to which the stream is attached.

Definition at line 173 of file mstream.cc.

References mEncoding, mFlags, mFormatMode, mOwnDevice, and mpDevice.

Referenced by OStream::copy().

void setDevice IODevice   dev
 

Sets the device for the stream.

Note:
The stream object takes ownership of the device, and destructs it properly.
Parameters:
dev  Device to give to the stream.

Definition at line 151 of file mstream.cc.

References mOwnDevice.


Member Data Documentation

Encoding mEncoding [protected]
 

The text encoding mode.

Definition at line 87 of file mstream.h.

Referenced by copy(), and Stream().

ulong mFlags [protected]
 

User-defined stream flags.

Definition at line 88 of file mstream.h.

Referenced by copy(), and Stream().

int mFormatMode [protected]
 

Formatting mode.

Definition at line 86 of file mstream.h.

Referenced by copy(), and Stream().

bool mOwnDevice [protected]
 

Does the object own the IODevice?

Definition at line 85 of file mstream.h.

Referenced by copy(), setDevice(), and Stream().


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