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::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

elm::io::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.
elm::io::StreamPipe::~StreamPipe ( void  )

Member Function Documentation

string elm::io::StreamPipe::lastErrorMessage ( void  ) const

Get the message associated with the last error.

Returns
Last error message.

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

int elm::io::StreamPipe::proceed ( void  )

Perform the copy from input stream to output stream.

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

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


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