YARP  2.3.68+225-20170329.5+gitb0d3289
Yet Another Robot Platform
yarp::os::StringOutputStream Class Reference

An OutputStream that produces a string. More...

#include <yarp/os/StringOutputStream.h>

+ Inheritance diagram for yarp::os::StringOutputStream:

Public Member Functions

 StringOutputStream ()
 
ConstString toString ()
 
void reset ()
 
virtual void write (const Bytes &b)
 Write a block of bytes to the stream. More...
 
virtual void close ()
 Terminate the stream. More...
 
virtual bool isOk ()
 Check if the stream is ok or in an error state. More...
 
const ConstStringstr ()
 
- Public Member Functions inherited from yarp::os::OutputStream
virtual ~OutputStream ()
 Destructor. More...
 
virtual void write (char ch)
 Write a single byte to the stream. More...
 
virtual void write (const Bytes &b, int offset, int len)
 Write a block of bytes to the stream. More...
 
virtual void flush ()
 Make sure all pending write operations are finished. More...
 
virtual void writeLine (const char *data, int len)
 Write some text followed by a line feed. More...
 
virtual bool setWriteTimeout (double timeout)
 Set activity timeout. More...
 
virtual bool setTypeOfService (int tos)
 
virtual int getTypeOfService ()
 

Private Attributes

ConstString data
 

Detailed Description

An OutputStream that produces a string.

Handy for testing purposes.

Definition at line 22 of file StringOutputStream.h.

Constructor & Destructor Documentation

◆ StringOutputStream()

yarp::os::StringOutputStream::StringOutputStream ( )
inline

Definition at line 26 of file StringOutputStream.h.

Member Function Documentation

◆ close()

virtual void yarp::os::StringOutputStream::close ( )
inlinevirtual

Terminate the stream.

Implements yarp::os::OutputStream.

Definition at line 41 of file StringOutputStream.h.

◆ isOk()

virtual bool yarp::os::StringOutputStream::isOk ( )
inlinevirtual

Check if the stream is ok or in an error state.

Returns
true iff the stream is ok

Implements yarp::os::OutputStream.

Definition at line 44 of file StringOutputStream.h.

◆ reset()

void yarp::os::StringOutputStream::reset ( )
inline

Definition at line 32 of file StringOutputStream.h.

◆ str()

const ConstString& yarp::os::StringOutputStream::str ( )
inline

Definition at line 48 of file StringOutputStream.h.

◆ toString()

ConstString yarp::os::StringOutputStream::toString ( )
inline

Definition at line 28 of file StringOutputStream.h.

◆ write()

virtual void yarp::os::StringOutputStream::write ( const Bytes b)
inlinevirtual

Write a block of bytes to the stream.

Parameters
bthe bytes to write

Implements yarp::os::OutputStream.

Reimplemented in yarp::os::impl::FakeTwoWayStream::ActiveStringOutputStream.

Definition at line 36 of file StringOutputStream.h.

Member Data Documentation

◆ data

ConstString yarp::os::StringOutputStream::data
private

Definition at line 51 of file StringOutputStream.h.


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