Project
Loading...
Searching...
No Matches
CompStream.h
Go to the documentation of this file.
1
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3
// All rights not expressly granted are reserved.
4
//
5
// This software is distributed under the terms of the GNU General Public
6
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7
//
8
// In applying this license CERN does not waive the privileges and immunities
9
// granted to it by virtue of its status as an Intergovernmental Organization
10
// or submit itself to any jurisdiction.
11
12
/* Local Variables: */
13
/* mode: c++ */
14
/* End: */
15
16
#ifndef COMPSTREAM_H
17
#define COMPSTREAM_H
18
23
24
#include <istream>
25
#include <fstream>
26
#include <ostream>
27
#include <string>
28
#include <boost/iostreams/filtering_streambuf.hpp>
29
30
namespace
o2
31
{
32
namespace
io
33
{
34
35
enum class
CompressionMethod
{
36
None
,
37
Gzip
,
38
Zlib
,
39
Bzip2
,
40
Lzma
41
};
42
54
class
icomp_stream
:
public
std::istream
55
{
56
public
:
57
using
streambuffer_t
= boost::iostreams::filtering_streambuf<boost::iostreams::input>;
58
62
icomp_stream
(std::string
filename
,
CompressionMethod
method =
CompressionMethod::None
);
63
67
icomp_stream
(std::istream& backend,
CompressionMethod
method =
CompressionMethod::None
);
68
72
icomp_stream
(std::string
filename
, std::string method);
73
77
icomp_stream
(std::istream& backend, std::string method);
78
79
private
:
80
streambuffer_t
mStreamBuffer;
81
std::ifstream mInputFile;
82
};
83
95
class
ocomp_stream
:
public
std::ostream
96
{
97
public
:
98
using
streambuffer_t
= boost::iostreams::filtering_streambuf<boost::iostreams::output>;
99
103
ocomp_stream
(std::string
filename
,
CompressionMethod
method =
CompressionMethod::None
);
104
108
ocomp_stream
(std::ostream& backend,
CompressionMethod
method =
CompressionMethod::None
);
109
113
ocomp_stream
(std::string
filename
, std::string method);
114
118
ocomp_stream
(std::ostream& backend, std::string method);
119
120
private
:
121
streambuffer_t
mStreamBuffer;
122
};
123
124
}
// namespace io
125
}
// namespace o2
126
#endif
// COMPSTREAM_H
o2::io::icomp_stream
Definition
CompStream.h:55
o2::io::icomp_stream::streambuffer_t
boost::iostreams::filtering_streambuf< boost::iostreams::input > streambuffer_t
Definition
CompStream.h:57
o2::io::ocomp_stream
Definition
CompStream.h:96
o2::io::ocomp_stream::streambuffer_t
boost::iostreams::filtering_streambuf< boost::iostreams::output > streambuffer_t
Definition
CompStream.h:98
o2::io::CompressionMethod
CompressionMethod
Definition
CompStream.h:35
o2::io::CompressionMethod::Gzip
@ Gzip
o2::io::CompressionMethod::None
@ None
o2::io::CompressionMethod::Bzip2
@ Bzip2
o2::io::CompressionMethod::Lzma
@ Lzma
o2::io::CompressionMethod::Zlib
@ Zlib
o2
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Definition
BitstreamReader.h:24
filename
std::string filename()
Definition
o2FairMQHeaderSizeTest.cxx:55
Common
Utils
include
CommonUtils
CompStream.h
Generated on Tue Feb 25 2025 17:02:50 for Project by
1.9.8