Telnet++  3.1.0.2
A C++ library for interacting with Telnet streams
Public Types | Public Member Functions | List of all members
telnetpp::options::mccp::codec Class Referenceabstract

Represents an object that can transform (encode or decode) arbitrary byte sequences. For this option, this implies compression and decompression. More...

#include <codec.hpp>

Inheritance diagram for telnetpp::options::mccp::codec:
telnetpp::options::mccp::zlib::compressor telnetpp::options::mccp::zlib::decompressor

Public Types

using continuation = std::function< void(telnetpp::bytes data, bool continuation_ended)>
 

Public Member Functions

virtual ~codec ()=default
 Destructor.
 
void start ()
 Starts the transformation stream. Calls to operator() now assume that the input requires transformation.
 
void finish (continuation const &cont)
 Finishes the current decompression stream. Calls to operator() now assume that the input does not require transformation.
 
void operator() (telnetpp::bytes data, continuation const &cont)
 Transform data, if the stream is started, sending the result of the transformation to the continuation. If the stream is not started, the data is passed on untransformed. More...
 

Detailed Description

Represents an object that can transform (encode or decode) arbitrary byte sequences. For this option, this implies compression and decompression.

Member Function Documentation

◆ operator()()

void telnetpp::options::mccp::codec::operator() ( telnetpp::bytes  data,
continuation const &  cont 
)

Transform data, if the stream is started, sending the result of the transformation to the continuation. If the stream is not started, the data is passed on untransformed.

Exceptions
corrupted_stream_errorif the data was malformed.

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