Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
TeeOutStream Class Reference

#include <elm/io/TeeOutStream.h>

+ Inheritance diagram for TeeOutStream:

Public Member Functions

 TeeOutStream (OutStream &out1, OutStream &out2)
 
int write (const char *buffer, int size) override
 
int flush (void) override
 
cstring lastErrorMessage (void) override
 
bool supportsANSI () const override
 
- Public Member Functions inherited from OutStream
virtual ~OutStream (void)
 
virtual int write (char byte)
 

Additional Inherited Members

- Static Public Attributes inherited from OutStream
static OutStreamnull = _null
 

Detailed Description

This class allows to divert the byte stream to two different outputs. This may be useful to perform an output while performing a parallel processing of the streamed data: size computation, checksumming, etc.

Constructor & Destructor Documentation

◆ TeeOutStream()

TeeOutStream ( OutStream out1,
OutStream out2 
)

Member Function Documentation

◆ flush()

int flush ( void  )
overridevirtual

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

Returns
0 for success, less than 0 for error.

Implements OutStream.

References OutStream::flush().

◆ lastErrorMessage()

cstring lastErrorMessage ( void  )
overridevirtual

Return a message for the last error.

Returns
Message of the last error.

Reimplemented from OutStream.

References OutStream::lastErrorMessage().

◆ supportsANSI()

bool supportsANSI ( ) const
overridevirtual

Test if the current stream knows how to decode ANSI special codes. The default implementation returns false.

Returns
True if ANSI code are supported, false else.

Reimplemented from OutStream.

References OutStream::supportsANSI().

◆ write()

int write ( const char *  buffer,
int  size 
)
overridevirtual

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.

Implements OutStream.

References OutStream::write().


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