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
13#include <xercesc/util/BinInputStream.hpp>
14#include <string>
15
16namespace OpenMS
17{
18 class ZipIfstream;
19
23 class OPENMS_DLLAPI ZipInputStream :
24 public xercesc::BinInputStream
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 XMLFilePos curPos() const override;
44
55 XMLSize_t readBytes(XMLByte* const to_fill, const XMLSize_t max_to_read) override;
56
62 const XMLCh* getContentType() const override;
63
64 ZipInputStream() = delete;
65 ZipInputStream(const ZipInputStream& stream) = delete;
66 ZipInputStream& operator=(const ZipInputStream& stream) = delete;
67
68private:
70 ZipIfstream* zip_ = nullptr;
73 };
74
75 inline XMLFilePos ZipInputStream::curPos() const
76 {
78 }
79
80} // namespace OpenMS
char16_t XMLCh
Definition ClassTest.h:30
Streaming reader for the single non-directory entry of a ZIP archive.
Definition ZipIfstream.h:37
Implements the BinInputStream class of the xerces-c library in order to read ZIP compressed XML files...
Definition ZipInputStream.h:25
ZipInputStream(const std::string &file_name)
Constructor.
bool getIsOpen() const
returns true if file is open
XMLSize_t file_current_index_
current index of the actual file
Definition ZipInputStream.h:72
ZipInputStream & operator=(const ZipInputStream &stream)=delete
ZipInputStream(const ZipInputStream &stream)=delete
~ZipInputStream() override
Destructor.
XMLSize_t readBytes(XMLByte *const to_fill, const XMLSize_t max_to_read) override
writes bytes into buffer from file
XMLFilePos curPos() const override
returns the current position in the file
Definition ZipInputStream.h:75
ZipInputStream(const char *const file_name)
const XMLCh * getContentType() const override
returns 0
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19