10 #ifndef YARP_OS_IMPL_FAKETWOWAYSTREAM_H
11 #define YARP_OS_IMPL_FAKETWOWAYSTREAM_H
31 this->out.owner =
this;
32 this->target = target;
37 this->target = ⌖
73 if (target !=
nullptr) {
85 return out.toString();
114 ActiveStringOutputStream() :
131 StringInputStream in;
132 ActiveStringOutputStream out;
135 StringInputStream* target;
A simple abstraction for a block of bytes.
Simple specification of the minimum functions needed from output streams.
virtual void write(char ch)
Write a single byte to the stream.
An OutputStream that produces a string.
virtual void write(char ch)
Write a single byte to the stream.
A stream which can be asked to perform bidirectional communication.
A dummy two way stream for testing purposes.
void beginPacket() override
Mark the beginning of a logical packet.
void close() override
Terminate the stream.
virtual void apply(const Bytes &b)
FakeTwoWayStream(StringInputStream *target=nullptr)
std::string getInputText() const
OutputStream & getOutputStream() override
Get an OutputStream to write to.
bool isOk() const override
Check if the stream is ok or in an error state.
void setTarget(StringInputStream &target)
std::string getOutputText() const
void addInputText(const std::string &str)
virtual StringInputStream & getStringInputStream()
const Contact & getRemoteAddress() const override
Get the address of the remote side of the stream.
void reset() override
Reset the stream.
void endPacket() override
Mark the end of a logical packet (see beginPacket).
InputStream & getInputStream() override
Get an InputStream to read from.
const Contact & getLocalAddress() const override
Get the address of the local side of the stream.
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
The main, catch-all namespace for YARP.