22 yCTrace(PORTCOMMAND,
"PortCommand::readBlock");
39 if (
str.length() > 0) {
51 if (
str.length() > 0) {
60 yCTrace(PORTCOMMAND,
"PortCommand::writeBlock");
61 yCDebug(PORTCOMMAND,
"Writing port command, text mode [%s]\n", writer.
isTextMode() ?
"true" :
"false");
65 len = (int)
str.length() + 1;
A simple abstraction for a block of bytes.
An interface for reading from a network connection.
virtual bool isTextMode() const =0
Check if the connection is text mode.
virtual bool expectBlock(char *data, size_t len)=0
Read a block of data from the network connection.
virtual std::string expectText(const char terminatingChar='\n')=0
Read some text from the network connection.
virtual bool isError() const =0
An interface for writing to a network connection.
virtual bool isError() const =0
virtual bool isTextMode() const =0
Check if the connection is text mode.
virtual void appendText(const std::string &str, const char terminate='\n')=0
Send a terminated string to the network connection.
virtual void appendBlock(const char *data, size_t len)=0
Send a block of data to the network connection.
const Bytes & bytes() const
static int netInt(const yarp::os::Bytes &code)
bool write(yarp::os::ConnectionWriter &writer) const override
Write this object to a network connection.
yarp::os::ManagedBytes header
#define yCAssert(component, x)
#define yCTrace(component,...)
#define yCDebug(component,...)
#define YARP_OS_LOG_COMPONENT(name, name_string)
The components from which ports and connections are built.
An interface to the operating system, including Port based communication.
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)