![]() |
GM6000 Digital Heater Controller Build: 20 (Branch = develop)
SDX-1330
|
This concrete class implements the Encoder API where the Output destination is a Cpl::Io::Output stream. More...
This concrete class implements the Encoder API where the Output destination is a Cpl::Io::Output stream.
There is no checking/enforcement of the content of the Frame (e.g. it will accept non-ASCII character) except for the SOF, EOF, and ESC characters.
#include <StreamEncoder.h>
Public Member Functions | |
| StreamEncoder (Cpl::Io::Output *dstPtr, char startOfFrame, char endOfFrame, char escapeChar, bool appendNewline=true) | |
| Constructor. | |
| void | setOutput (Cpl::Io::Output &newOutfd) noexcept |
| Allow the consumer to change/Set the Output stream handle. Note: No guarantees on what happens if this method is called in the 'middle of a frame'. | |
Public Member Functions inherited from Cpl::Text::Frame::Encoder_ | |
| bool | startFrame (void) noexcept |
| See Cpl::Text::Frame::Encoder. | |
| bool | output (char src) noexcept |
| See Cpl::Text::Frame::Encoder. | |
| bool | output (const char *src) noexcept |
| See Cpl::Text::Frame::Encoder. | |
| bool | output (const char *src, size_t numBytes) noexcept |
| See Cpl::Text::Frame::Encoder. | |
| bool | endFrame (void) noexcept |
| See Cpl::Text::Frame::Encoder. | |
Public Member Functions inherited from Cpl::Text::Frame::Encoder | |
| virtual | ~Encoder () |
| Virtual Destructor. | |
Protected Member Functions | |
| bool | start (char src) noexcept |
| See Cpl::Text::Frame::Encoder_. | |
| bool | start () noexcept |
| See Cpl::Text::Frame::Encoder_. | |
| bool | append (char src) noexcept |
| See Cpl::Text::Frame::Encoder_. | |
Protected Member Functions inherited from Cpl::Text::Frame::Encoder_ | |
| Encoder_ (char startOfFrame, char endOfFrame, char escapeChar, bool appendNewline=true) | |
| Constructor. | |
| virtual char | encodeChar (char charToBeEscaped) |
| Returns the encoded/escaped value for the specified special character. | |
Protected Attributes | |
| Cpl::Io::Output * | m_dstPtr |
| Output stream. | |
Protected Attributes inherited from Cpl::Text::Frame::Encoder_ | |
| bool | m_inFrame |
| Output/Frame state. | |
| const char | m_sof |
| SOF character. | |
| const char | m_eof |
| EOF character. | |
| const char | m_esc |
| Escape character. | |
| const bool | m_appendNewline |
| Remember my newline option. | |
| Cpl::Text::Frame::StreamEncoder::StreamEncoder | ( | Cpl::Io::Output * | dstPtr, |
| char | startOfFrame, | ||
| char | endOfFrame, | ||
| char | escapeChar, | ||
| bool | appendNewline = true ) |
Constructor.
The Output Stream is not required to be specified at construction time (i.e. 'dstPtr' can be zero). However, the encoder must have a valid Output Stream handle BEFORE the start() method is called. When 'appendNewline' argument is set to true - encoder will append a newline character to the output stream AFTER the EOF character (this can make for more human readable output stream).
NOTE: If 'startOfFrame' is '\0', then Encoder will begin the frame WITHOUT inserting a SOF character. This is useful when there application desires/has multiple start-of-frame characters for a given frame.
|
protectedvirtualnoexcept |
See Cpl::Text::Frame::Encoder_.
Implements Cpl::Text::Frame::Encoder_.
|
noexcept |
Allow the consumer to change/Set the Output stream handle. Note: No guarantees on what happens if this method is called in the 'middle of a frame'.
|
protectedvirtualnoexcept |
See Cpl::Text::Frame::Encoder_.
Implements Cpl::Text::Frame::Encoder_.
|
protectedvirtualnoexcept |
See Cpl::Text::Frame::Encoder_.
Implements Cpl::Text::Frame::Encoder_.
|
protected |
Output stream.