17 Meta m(
"compressor",
"chain");
39 auto& option_value =
env().
option(option);
40 DCHECK(option_value.is_algorithm());
46 DVLOG(1) <<
"dynamic creation of" << av.name() <<
"\n";
47 auto compressor = create_algo_with_registry_dynamic(
48 tdc_algorithms::COMPRESSOR_REGISTRY, av);
50 f(i, o, *compressor, textds_flags);
53 std::vector<uint8_t> between_buf;
55 Output between(between_buf);
56 run(input, between, first_algo);
60 Input between(between_buf);
61 run(between, output, second_algo);
76 auto i2 =
Input(i, flags);
95 auto o2 =
Output(o, flags);
ChainCompressor()=delete
No default construction allowed.
virtual void compress(Input &input, Output &output) override final
Compress inp into out.
Contains the text compression and encoding framework.
ChainCompressor(Env &&env)
Construct the class with an environment and the algorithms to chain.
io::Input Input
Convenience shortcut to io::Input.
std::string vec_to_debug_string(const T &s, size_t indent=0)
Builds the string representation of a vector of byte values, sorrounded by square brackets ([ and ])...
A const view into a slice of memory.
const OptionValue & option(const std::string &option) const
Get an option of this algorithm.
Base for data compressors.
void chain(Input &input, Output &output, bool reverse, F f)
ds::InputRestrictionsAndFlags textds_flags() const
void swap(IntVector< T > &lhs, IntVector< T > &rhs)
Env & env()
Provides access to the environment that the algorithm works in.
An abstraction layer for algorithm output.
virtual void compress(Input &input, Output &output)=0
Compress the given input to the given output.
Local environment for a compression/encoding/decompression call.
const AlgorithmValue & as_algorithm() const
virtual void decompress(Input &input, Output &output)=0
Decompress the given input to the given output.
virtual void decompress(Input &input, Output &output) override final
Decompress inp into out.
io::Output Output
Convenience shortcut to io::Output.