OpenMS
Loading...
Searching...
No Matches
ZipInputStream.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: Timo Sachsenberg $
7// --------------------------------------------------------------------------
8
9#pragma once
10
11#include <OpenMS/config.h>
12
14#include <string>
15
16namespace OpenMS
17{
18 class ZipIfstream;
19
23 class OPENMS_DLLAPI ZipInputStream :
24 public InputStream
25 {
26public:
28 explicit ZipInputStream(const std::string& file_name);
29
30 explicit ZipInputStream(const char* const file_name);
31
33 ~ZipInputStream() override;
34
36 bool getIsOpen() const;
37
43 UInt64 curPos() const override;
44
55 Size readBytes(unsigned char* const to_fill, const Size max_to_read) override;
56
57
58 ZipInputStream() = delete;
59 ZipInputStream(const ZipInputStream& stream) = delete;
60 ZipInputStream& operator=(const ZipInputStream& stream) = delete;
61
62private:
64 ZipIfstream* zip_ = nullptr;
67 };
68
70 {
72 }
73
74} // namespace OpenMS
Internal byte stream shared by the XML compression adapters.
Definition InputStream.h:16
Streaming reader for the single non-directory entry of a ZIP archive.
Definition ZipIfstream.h:37
Byte stream for reading ZIP compressed XML files.
Definition ZipInputStream.h:25
ZipInputStream(const std::string &file_name)
Constructor.
bool getIsOpen() const
returns true if file is open
UInt64 curPos() const override
returns the current position in the file
Definition ZipInputStream.h:69
Size readBytes(unsigned char *const to_fill, const Size max_to_read) override
writes bytes into buffer from file
ZipInputStream & operator=(const ZipInputStream &stream)=delete
ZipInputStream(const ZipInputStream &stream)=delete
~ZipInputStream() override
Destructor.
UInt64 file_current_index_
current index of the actual file
Definition ZipInputStream.h:66
ZipInputStream(const char *const file_name)
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