Telnet++
A C++ library for interacting with Telnet streams
decompressor.hpp
1 #pragma once
2 
3 #include "telnetpp/core.hpp"
4 #include <boost/exception/all.hpp>
5 #include <tuple>
6 #include <stdexcept>
7 
8 namespace telnetpp { namespace options { namespace mccp {
9 
10 //* =========================================================================
12 //* =========================================================================
14 {
15 public :
16  //* =====================================================================
18  //* =====================================================================
19  virtual ~decompressor() {}
20 
21  //* =====================================================================
28  //* =====================================================================
29  virtual std::tuple<telnetpp::u8stream, bool> decompress(
30  telnetpp::u8 byte) = 0;
31 
32  //* =====================================================================
35  //* =====================================================================
36  virtual void end_decompression() = 0;
37 };
38 
39 //* =========================================================================
42 //* =========================================================================
44  : virtual std::domain_error,
45  virtual boost::exception
46 {
47 public :
48  corrupted_stream_error(std::string const &what_arg);
49  corrupted_stream_error(char const *what_arg);
50 };
51 
52 }}}
virtual void end_decompression()=0
Ends the current decompression stream.
Represents an object that can decompress arbitrary byte sequences.
Definition: decompressor.hpp:13
virtual std::tuple< telnetpp::u8stream, bool > decompress(telnetpp::u8 byte)=0
Decompress the given byte, and return a tuple of the decompressed data and a boolean that is set to t...
An exception that is thrown in the case that a stream of data cannot be decompressed.
Definition: decompressor.hpp:43
Definition: byte_converter.hpp:4
virtual ~decompressor()
Destructor.
Definition: decompressor.hpp:19