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

#include <elm/io/StreamPipe.h>

Public Member Functions

 StreamPipe (InStream &in, OutStream &out, int buffer_size=1<< 16)
 
 ~StreamPipe (void)
 
int proceed (void)
 
string lastErrorMessage (void) const
 

Detailed Description

A stream pipe allows to pipe together a string of input stream and a string of output stream. When the proceed() method is called, the input stream is read to the end and write back to the output stream.

Constructor & Destructor Documentation

◆ StreamPipe()

StreamPipe ( InStream in,
OutStream out,
int  buffer_size = 1 << 16 
)

build a stream pipe.

Parameters
inInput stream.
outOutput stream.
buffer_sizeSize of the buffer.

◆ ~StreamPipe()

~StreamPipe ( void  )

Member Function Documentation

◆ lastErrorMessage()

string lastErrorMessage ( void  ) const

Get the message associated with the last error.

Returns
Last error message.

References InStream::lastErrorMessage(), and OutStream::lastErrorMessage().

◆ proceed()

int proceed ( void  )

Perform the copy from input stream to output stream.

Returns
Number of copied bytes or <0 if there is an error.

References InStream::ENDED, InStream::FAILED, InStream::read(), and OutStream::write().


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