Library: OSP/Shell
Package: Shell
Header: Poco/OSP/Shell/ResponseStream.h
This stream wraps all lines sent through it in SMTP (RFC 2821) format.
Lines are grouped together in blocks, which every block having the format of an RFC 2821 server response message.
The block begins with a three-digit status code, followed by either a minus sign ('-') if more lines follow, or a space character (' '), if the line is the only line in this block. All lines but the last line in a block also start with a three-digit status code and a minus character. The last line starts with a three-digit status code, a space character and the line data.
Examples:
100-This is a multiline 100-message. The message 100 has three lines in total. 200 OK
Direct Base Classes: Poco::UnbufferedStreamBuf
All Base Classes: Poco::UnbufferedStreamBuf
Member Functions: flushLine, getStatus, setStatus, sync, writeToDevice
ResponseStreamBuf(
std::ostream & ostr,
int status
);
Creates the ResponseStreamBuf and connects it to the given output stream.
Destroys the ResponseStreamBuf.
int getStatus() const;
Returns the status code that is prepended to response lines.
void setStatus(
int status
);
Sets the status code that is prepended to response lines.
int sync();
Flushes the currently buffered line and ends the response block.
void flushLine(
bool more
);
int writeToDevice(
char c
);