18#include <boost/iostreams/device/file.hpp>
19#include <boost/iostreams/stream.hpp>
20#include <boost/iostreams/copy.hpp>
21#include <boost/iostreams/filter/gzip.hpp>
22#include <boost/iostreams/filter/zlib.hpp>
23#include <boost/iostreams/filter/bzip2.hpp>
33namespace comp_stream_helpers
40 stream.push(boost::iostreams::gzip_decompressor());
43 stream.push(boost::iostreams::zlib_decompressor());
46 throw std::runtime_error(
"lzma support not enabled");
50 stream.push(boost::iostreams::bzip2_decompressor());
55 throw std::invalid_argument(
"missing implementation");
64 stream.push(boost::iostreams::gzip_compressor());
67 stream.push(boost::iostreams::zlib_compressor());
70 throw std::runtime_error(
"lzma support not enabled");
74 stream.push(boost::iostreams::bzip2_compressor());
79 throw std::invalid_argument(
"missing implementation");
83const std::map<std::string, CompressionMethod>
Mapping = {
93 auto const&
i =
Mapping.find(method);
95 throw std::invalid_argument(
"invalid compression method: " + method);
102 : mStreamBuffer(), mInputFile(
filename,
std::ios_base::in |
std::ios_base::
binary),
std::istream(&mStreamBuffer)
105 mStreamBuffer.push(mInputFile);
109 : mStreamBuffer(), mInputFile(),
std::istream(&mStreamBuffer)
112 mStreamBuffer.push(backend);
116 : mStreamBuffer(), mInputFile(
filename,
std::ios_base::in |
std::ios_base::
binary),
std::istream(&mStreamBuffer)
119 mStreamBuffer.push(mInputFile);
123 : mStreamBuffer(), mInputFile(),
std::istream(&mStreamBuffer)
126 mStreamBuffer.push(backend);
130 : mStreamBuffer(),
std::ostream(&mStreamBuffer)
133 mStreamBuffer.push(boost::iostreams::file_sink(
filename));
137 : mStreamBuffer(),
std::ostream(&mStreamBuffer)
140 mStreamBuffer.push(backend);
144 : mStreamBuffer(),
std::ostream(&mStreamBuffer)
147 mStreamBuffer.push(boost::iostreams::file_sink(
filename));
151 : mStreamBuffer(),
std::ostream(&mStreamBuffer)
154 mStreamBuffer.push(backend);
Implementation of iostreams with compression filter.
Checks validity of hardware address (HW) and transform it to digit AbsId index.
icomp_stream(std::string filename, CompressionMethod method=CompressionMethod::None)
ocomp_stream(std::string filename, CompressionMethod method=CompressionMethod::None)
const GLuint GLenum const void * binary
void pushDecompressor(T &stream, CompressionMethod method)
auto Method(std::string method)
void pushCompressor(T &stream, CompressionMethod method)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Defining DataPointCompositeObject explicitly as copiable.