libfly  6.2.2
C++20 utility library for Linux, macOS, and Windows
fly::coders::BinaryEncoder Class Referenceabstract

#include <coder.hpp>

Inheritance diagram for fly::coders::BinaryEncoder:
Collaboration diagram for fly::coders::BinaryEncoder:

Protected Member Functions

bool encode_internal (std::istream &decoded, std::ostream &encoded) final
 
virtual bool encode_binary (std::istream &decoded, fly::BitStreamWriter &encoded)=0
 

Additional Inherited Members

- Public Member Functions inherited from fly::coders::Encoder
virtual ~Encoder ()=default
 
virtual bool encode_string (const std::string &decoded, std::string &encoded)
 
virtual bool encode_file (const std::filesystem::path &decoded, const std::filesystem::path &encoded)
 

Detailed Description

Virtual interface to encode a string or file with a binary encoder. Coders for specific algorithms should inherit from this class to perform encoding.

Author
Timothy Flynn (trfly.nosp@m.nn89.nosp@m.@pm.m.nosp@m.e)
Version
May 3, 2020

Member Function Documentation

◆ encode_binary()

virtual bool fly::coders::BinaryEncoder::encode_binary ( std::istream &  decoded,
fly::BitStreamWriter encoded 
)
protectedpure virtual

Encode a stream.

Parameters
decodedStream holding the contents to encode.
encodedStream to store the encoded contents.
Returns
True if the input stream was successfully encoded.

Implemented in fly::coders::HuffmanEncoder.

◆ encode_internal()

bool fly::coders::BinaryEncoder::encode_internal ( std::istream &  decoded,
std::ostream &  encoded 
)
finalprotectedvirtual

Encode a stream.

Parameters
decodedStream holding the contents to encode.
encodedStream to store the encoded contents.
Returns
True if the input stream was successfully encoded.

Implements fly::coders::Encoder.


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