5 #include <libutl/CRC32.h> 6 #include <libutl/BufferedStream.h> 53 set(mode, stream, owner);
67 return isCRC() ? _crc.get() : _lastCRC;
81 return getFlag(flg_crc);
88 setFlag(flg_crc, crc);
98 virtual size_t decode(
byte_t* block,
size_t num) = 0;
106 virtual size_t encode(
const byte_t* block,
size_t num) = 0;
115 void set(
uint_t mode,
Stream* stream,
bool owner =
true,
size_t bufSize =
KB(16));
118 virtual void clear();
126 return getFlag(flg_lastBlock);
133 setFlag(flg_lastBlock, lastBlock);
138 virtual void overflow();
141 virtual void underflow();
144 virtual void finishEncoding();
147 virtual size_t finishDecoding();
void deInit()
De-initialize UTL++.
Encoder/decoder abstraction.
uint32_t getCRC() const
Get the CRC code.
uint32_t getLastCRC() const
Get the last CRC code.
unsigned char byte_t
Unsigned character.
void setLastBlock(bool lastBlock)
Set the lastBlock flag.
unsigned int uint32_t
Unsigned 32-bit integer.
bool isLastBlock() const
Get the lastBlock flag.
Encoder(uint_t mode, Stream *stream, bool owner=true)
Constructor.
bool isCRC() const
Get the crc flag.
#define UTL_CLASS_DECL_ABC(DC, BC)
Declaration of standard UTL++ functionality for an abstract base class (ABC).
unsigned int uint_t
Unsigned integer.
void setCRC(bool crc)
Set the crc flag.
constexpr size_t KB(size_t n)
Convert size in kilobytes to size in bytes.
Generate CRC-32 checksums.
#define UTL_CLASS_NO_COPY
Declare that a class cannot do copy().
void init()
Initialize UTL++.