An OutputStream that produces a string. More...
#include <yarp/os/StringOutputStream.h>
Public Member Functions | |
StringOutputStream () | |
std::string | toString () const |
void | reset () |
void | write (const Bytes &b) override |
Write a block of bytes to the stream. | |
void | close () override |
Terminate the stream. | |
bool | isOk () const override |
Check if the stream is ok or in an error state. | |
const std::string & | str () const |
virtual void | write (char ch) |
Write a single byte to the stream. | |
virtual void | write (const Bytes &b, int offset, int len) |
Write a block of bytes to the stream. | |
virtual void | write (const yarp::os::Bytes &b)=0 |
Write a block of bytes to the stream. | |
![]() | |
virtual | ~OutputStream () |
Destructor. | |
virtual void | flush () |
Make sure all pending write operations are finished. | |
virtual void | writeLine (const char *data, int len) |
Write some text followed by a line feed. | |
virtual bool | setWriteTimeout (double timeout) |
Set activity timeout. | |
virtual bool | setTypeOfService (int tos) |
virtual int | getTypeOfService () |
An OutputStream that produces a string.
Handy for testing purposes.
Definition at line 20 of file StringOutputStream.h.
|
inline |
Definition at line 25 of file StringOutputStream.h.
|
inlineoverridevirtual |
Terminate the stream.
Implements yarp::os::OutputStream.
Definition at line 45 of file StringOutputStream.h.
|
inlineoverridevirtual |
Check if the stream is ok or in an error state.
Implements yarp::os::OutputStream.
Definition at line 49 of file StringOutputStream.h.
|
inline |
Definition at line 34 of file StringOutputStream.h.
|
inline |
Definition at line 54 of file StringOutputStream.h.
|
inline |
Definition at line 29 of file StringOutputStream.h.
Write a single byte to the stream.
By default, this calls write(const Bytes& b) to do its work.
ch | the byte to write |
Reimplemented from yarp::os::OutputStream.
Definition at line 34 of file OutputStream.cpp.
Write a block of bytes to the stream.
b | the bytes to write |
Implements yarp::os::OutputStream.
Definition at line 39 of file StringOutputStream.h.
Write a block of bytes to the stream.
By default, this calls write(const Bytes& b) to do its work.
b | the bytes to write |
offset | an offset within the block to start at |
len | the number of bytes to write |
Reimplemented from yarp::os::OutputStream.
Definition at line 44 of file OutputStream.cpp.
|
virtual |
Write a block of bytes to the stream.
b | the bytes to write |
Implements yarp::os::OutputStream.