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

#include <coder.hpp>

Inheritance diagram for fly::coders::Decoder:

Public Member Functions

virtual ~Decoder ()=default
 
bool decode_string (const std::string &encoded, std::string &decoded)
 
bool decode_file (const std::filesystem::path &encoded, const std::filesystem::path &decoded)
 

Protected Member Functions

virtual bool decode_internal (std::istream &encoded, std::ostream &decoded)=0
 

Detailed Description

Virtual interface to decode a string or file with a plaintext decoder. Coders for specific algorithms should inherit from this class to perform decoding.

Author
Timothy Flynn (trfly.nosp@m.nn89.nosp@m.@pm.m.nosp@m.e)
Version
July 7, 2019

Constructor & Destructor Documentation

◆ ~Decoder()

virtual fly::coders::Decoder::~Decoder ( )
virtualdefault

Destructor.

Member Function Documentation

◆ decode_file()

bool fly::coders::Decoder::decode_file ( const std::filesystem::path &  encoded,
const std::filesystem::path &  decoded 
)

Decode a file.

Parameters
encodedPath holding the contents to decode.
decodedPath to store the decoded contents.
Returns
True if the input file was successfully decoded.

◆ decode_internal()

virtual bool fly::coders::Decoder::decode_internal ( std::istream &  encoded,
std::ostream &  decoded 
)
protectedpure virtual

Decode a stream.

Parameters
encodedStream holding the contents to decode.
decodedStream to store the decoded contents.
Returns
bool True if the input stream was successfully decoded.

Implemented in fly::coders::Base64Coder, and fly::coders::BinaryDecoder.

◆ decode_string()

bool fly::coders::Decoder::decode_string ( const std::string &  encoded,
std::string &  decoded 
)

Decode a string.

Parameters
encodedString holding the contents to decode.
decodedString to store the decoded contents.
Returns
True if the input string was successfully decoded.

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