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

TextOStream Class Reference

Text output stream. More...

#include <mtextstream.h>

Inheritance diagram for TextOStream:

OStream TextStream Stream List of all members.

Public Methods

 TextOStream (String &buffer, int mode=IO_Writable)
 TextOStream (FILE *strm=stdout)
 TextOStream (TextOStream &o)
virtual TextOStream & printf (const char *format,...)
virtual TextOStream & operator<< (const char *str)
virtual TextOStream & operator<< (const String &str)
virtual TextOStream & operator<< (const char)
virtual TextOStream & operator<< (const int)
virtual TextOStream & operator<< (const long)
virtual TextOStream & operator<< (const float)
virtual TextOStream & operator<< (const double)
virtual uint writeRawBytes (const char *p, uint n)

Detailed Description

Text output stream.

Definition at line 91 of file mtextstream.h.

Constructor & Destructor Documentation

TextOStream String   buffer,
int    mode = IO_Writable

Opens a stream attached to the given string buffer.


        String myBuffer;
        OStream(myBuffer) << "Put some text there " << 123 << 42.42 << '\n';
        OStream(myBuffer, IO_Append) << " Some appended text";
buffer  Buffer to write to.

Definition at line 119 of file

TextOStream FILE *    strm = stdout

Construction from a FILE output stream.


        FILE* myfile = fopen ("myfile.ext", "w");
      OStream mystream (out);       // Attach to opened stream.
      OStream outstd (stdout);  // Attach to standard output stream.

It is assumed that the FILE stream really is open.
strm  Already opened FILE stream to use.

Definition at line 96 of file

TextOStream TextOStream &    orig

Copy constructor.

orig  Stream object to copy.

Definition at line 104 of file

Member Function Documentation

TextOStream & operator<< const char *    str [virtual]

Print zero-terminated character string.

Implements OStream.

Definition at line 155 of file

References IODevice::writeBlock().

TextOStream & printf const char *    sformat,

Print formatted string.

Reimplemented from OStream.

Definition at line 126 of file

References IODevice::flush(), and IODevice::writeBlock().

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