OpenMS
Loading...
Searching...
No Matches
GzipInputStream.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Timo Sachsenberg $
6// $Authors: David Wojnar $
7// --------------------------------------------------------------------------
8
9#pragma once
10
11#include <OpenMS/config.h>
12
14#include <string>
15
16namespace OpenMS
17{
18 class GzipIfstream;
19
24 class OPENMS_DLLAPI GzipInputStream :
25 public InputStream
26 {
27public:
29 explicit GzipInputStream(const std::string& file_name);
30
31 explicit GzipInputStream(const char* const file_name);
32
34 ~GzipInputStream() override;
35
37 bool getIsOpen() const;
38
44 UInt64 curPos() const override;
45
57 Size readBytes(unsigned char* const to_fill, const Size max_to_read) override;
58
59
60 GzipInputStream() = delete;
61 GzipInputStream(const GzipInputStream& stream) = delete;
62 GzipInputStream& operator=(const GzipInputStream& stream) = delete;
63
64private:
66 GzipIfstream* gzip_ = nullptr;
69 };
70
72 {
74 }
75
76} // namespace OpenMS
77
Decompresses files which are compressed in the gzip format (*.gzip)
Definition GzipIfstream.h:29
Byte stream for reading gzip compressed XML files.
Definition GzipInputStream.h:26
~GzipInputStream() override
Destructor.
bool getIsOpen() const
returns true if file is open
UInt64 curPos() const override
returns the current position in the file
Definition GzipInputStream.h:71
Size readBytes(unsigned char *const to_fill, const Size max_to_read) override
writes bytes into buffer from file
GzipInputStream(const GzipInputStream &stream)=delete
GzipInputStream & operator=(const GzipInputStream &stream)=delete
UInt64 file_current_index_
current index of the actual file
Definition GzipInputStream.h:68
GzipInputStream(const char *const file_name)
GzipInputStream(const std::string &file_name)
Constructor.
Internal byte stream shared by the XML compression adapters.
Definition InputStream.h:16
uint64_t UInt64
Unsigned integer type (64bit)
Definition Types.h:47
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19