Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::io::OutStream Class Referenceabstract

#include <elm/io/OutStream.h>

+ Inheritance diagram for elm::io::OutStream:

Public Member Functions

virtual ~OutStream (void)
 
virtual int write (const char *buffer, int size)=0
 
virtual int write (char byte)
 
virtual int flush (void)=0
 
virtual CString lastErrorMessage (void)
 

Static Public Attributes

static OutStreamnull = _null
 

Detailed Description

An output stream streams transfer a flow of bytes to another entity. It is an abstract interface that must be implemented by standard IO, files, pipes, compressors and so on.

Constructor & Destructor Documentation

virtual elm::io::OutStream::~OutStream ( void  )
virtual

Member Function Documentation

int elm::io::OutStream::flush ( void  )
pure virtual

Cause the current stream to dump its buffer to the medium.

Returns
0 for success, less than 0 for error.

Implemented in elm::checksum::MD5, elm::io::BufferedOutStream, elm::io::TeeOutStream, elm::io::BlockOutStream, elm::io::UnixOutStream, and elm::io::WinOutStream.

Referenced by elm::io::TeeOutStream::flush(), and elm::io::Output::flush().

int elm::io::OutStream::write ( const char *  buffer,
int  size 
)
pure virtual

This is the main method of an output stream: the given buffer is put on the stream.

Parameters
bufferByte buffer to write.
sizeSize of the byte buffer.
Returns
Number of transferred bytes or less than 0 for an error.

Implemented in elm::checksum::MD5, elm::io::BufferedOutStream, elm::io::TeeOutStream, elm::io::BlockOutStream, elm::io::UnixOutStream, and elm::io::WinOutStream.

Referenced by elm::io::BufferedOutStream::flush(), elm::util::Formatter::format(), elm::io::Output::format(), elm::io::Output::print(), elm::io::StreamPipe::proceed(), elm::io::TeeOutStream::write(), write(), elm::io::BufferedOutStream::write(), and elm::xom::Serializer::writeRaw().

int elm::io::OutStream::write ( char  byte)
virtual

Write a byte to the stream.

Parameters
byteByte to write.
Returns
1 for success or less than 0 for an error.

Reimplemented in elm::io::BlockOutStream.

References elm::io::byte(), and write().

Member Data Documentation

OutStream & elm::io::OutStream::null = _null
static

Provides an output stream that does nothing.


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