Disk ARchive 2.7.16
Full featured and portable backup and archiving tool
|
compression class for gzip and bzip2 algorithms More...
#include <compressor.hpp>
Inherits libdar::proto_compressor.
Public Member Functions | |
compressor (compression x_algo, generic_file &compressed_side, U_I compression_level=9) | |
compressor (const compressor &ref)=delete | |
compressor (compressor &&ref) noexcept=delete | |
compressor & | operator= (const compressor &ref)=delete |
compressor & | operator= (compressor &&ref) noexcept=delete |
virtual compression | get_algo () const override |
virtual void | suspend_compression () override |
virtual void | resume_compression () override |
virtual bool | is_compression_suspended () const override |
virtual bool | skippable (skippability direction, const infinint &amount) override |
whether the implementation is able to skip More... | |
virtual bool | skip (const infinint &pos) override |
skip at the absolute position More... | |
virtual bool | skip_to_eof () override |
skip to the end of file More... | |
virtual bool | skip_relative (S_I x) override |
skip relatively to the current position More... | |
virtual bool | truncatable (const infinint &pos) const override |
whether the implementation is able to truncate to the given position More... | |
virtual infinint | get_position () const override |
get the current read/write position More... | |
Protected Member Functions | |
virtual void | inherited_read_ahead (const infinint &amount) override |
tells the object that several calls to read() will follow to probably obtain at least the given amount of data More... | |
virtual U_I | inherited_read (char *a, U_I size) override |
implementation of read() operation More... | |
virtual void | inherited_write (const char *a, U_I size) override |
implementation of the write() operation More... | |
virtual void | inherited_truncate (const infinint &pos) override |
truncate file at the give offset More... | |
virtual void | inherited_sync_write () override |
write down any pending data More... | |
virtual void | inherited_flush_read () override |
reset internal engine, flush caches in order to read the data at current position More... | |
virtual void | inherited_terminate () override |
destructor-like call, except that it is allowed to throw exceptions More... | |
Private Member Functions | |
void | flush_write () |
drop all pending write and reset compression engine | |
Private Attributes | |
xfer * | compr |
datastructure for bzip2, gzip and zx compression (not use with compression::none More... | |
bool | read_mode |
read-only mode or write-only mode, read-write is write-only mode More... | |
generic_file * | compressed |
where to read from/write to compressed data More... | |
compression | algo |
compression algorithm used More... | |
bool | suspended |
whether compression is temporary suspended More... | |
compression class for gzip and bzip2 algorithms
Definition at line 44 of file compressor.hpp.
libdar::compressor::compressor | ( | compression | x_algo, |
generic_file & | compressed_side, | ||
U_I | compression_level = 9 |
||
) |
x_algo | only gzip, bzip2, xz and none are supported by this class |
compressed_side | where to read from/write to compressed data |
compression_level | compression level 1..9 |
|
delete |
|
inlineoverridevirtual |
get the current read/write position
Implements libdar::generic_file.
Definition at line 76 of file compressor.hpp.
References compr.
|
overrideprotectedvirtual |
reset internal engine, flush caches in order to read the data at current position
Implements libdar::generic_file.
Referenced by skip(), skip_relative(), and skip_to_eof().
|
overrideprotectedvirtual |
implementation of read() operation
[in,out] | a | where to put the data to read |
[in] | size | says how much data to read |
Implements libdar::generic_file.
|
inlineoverrideprotectedvirtual |
tells the object that several calls to read() will follow to probably obtain at least the given amount of data
[in] | amount | is the maximum expected amount of data that is known to be read |
Implements libdar::generic_file.
Definition at line 79 of file compressor.hpp.
References compressed, and libdar::generic_file::read_ahead().
|
overrideprotectedvirtual |
write down any pending data
Implements libdar::generic_file.
Referenced by skip(), skip_relative(), and skip_to_eof().
|
overrideprotectedvirtual |
destructor-like call, except that it is allowed to throw exceptions
Implements libdar::generic_file.
|
overrideprotectedvirtual |
truncate file at the give offset
Implements libdar::generic_file.
|
overrideprotectedvirtual |
implementation of the write() operation
[in] | a | what data to write |
[in] | size | amount of data to write |
Implements libdar::generic_file.
|
inlineoverridevirtual |
Definition at line 66 of file compressor.hpp.
|
inlineoverridevirtual |
skip at the absolute position
[in] | pos | the offset in byte where next read/write operation must start |
Implements libdar::generic_file.
Definition at line 72 of file compressor.hpp.
References compressed, inherited_flush_read(), inherited_sync_write(), and libdar::generic_file::skip().
|
inlineoverridevirtual |
skip relatively to the current position
Implements libdar::generic_file.
Definition at line 74 of file compressor.hpp.
References compressed, inherited_flush_read(), inherited_sync_write(), and libdar::generic_file::skip_relative().
|
inlineoverridevirtual |
skip to the end of file
Implements libdar::generic_file.
Definition at line 73 of file compressor.hpp.
References compressed, inherited_flush_read(), inherited_sync_write(), and libdar::generic_file::skip_to_eof().
|
inlineoverridevirtual |
whether the implementation is able to skip
Implements libdar::generic_file.
Definition at line 71 of file compressor.hpp.
References compressed, and libdar::generic_file::skippable().
|
inlineoverridevirtual |
whether the implementation is able to truncate to the given position
Implements libdar::generic_file.
Definition at line 75 of file compressor.hpp.
References compressed, and libdar::generic_file::truncatable().
|
private |
compression algorithm used
Definition at line 101 of file compressor.hpp.
|
private |
datastructure for bzip2, gzip and zx compression (not use with compression::none
Definition at line 98 of file compressor.hpp.
Referenced by get_position().
|
private |
where to read from/write to compressed data
Definition at line 100 of file compressor.hpp.
Referenced by inherited_read_ahead(), skip(), skip_relative(), skip_to_eof(), skippable(), and truncatable().
|
private |
read-only mode or write-only mode, read-write is write-only mode
Definition at line 99 of file compressor.hpp.
|
private |
whether compression is temporary suspended
Definition at line 102 of file compressor.hpp.