OpenMS
Loading...
Searching...
No Matches
ZipInputStream Class Reference

Byte stream for reading ZIP compressed XML files. More...

#include <OpenMS/FORMAT/ZipInputStream.h>

Inheritance diagram for ZipInputStream:
InputStream

Public Member Functions

 ZipInputStream (const std::string &file_name)
 Constructor.
 
 ZipInputStream (const char *const file_name)
 
 ~ZipInputStream () override
 Destructor.
 
bool getIsOpen () const
 returns true if file is open
 
UInt64 curPos () const override
 returns the current position in the file
 
Size readBytes (unsigned char *const to_fill, const Size max_to_read) override
 writes bytes into buffer from file
 
 ZipInputStream ()=delete
 
 ZipInputStream (const ZipInputStream &stream)=delete
 
ZipInputStream & operator= (const ZipInputStream &stream)=delete
 
- Public Member Functions inherited from InputStream
virtual ~InputStream ()=default
 
virtual void cancel ()
 

Private Attributes

ZipIfstream * zip_ = nullptr
 pointer to the zip decompression stream
 
UInt64 file_current_index_
 current index of the actual file
 

Detailed Description

Byte stream for reading ZIP compressed XML files.

Constructor & Destructor Documentation

◆ ZipInputStream() [1/4]

ZipInputStream ( const std::string &  file_name)
explicit

Constructor.

◆ ZipInputStream() [2/4]

ZipInputStream ( const char *const  file_name)
explicit

◆ ~ZipInputStream()

~ZipInputStream ( )
override

Destructor.

◆ ZipInputStream() [3/4]

ZipInputStream ( )
delete

◆ ZipInputStream() [4/4]

ZipInputStream ( const ZipInputStream &  stream)
delete

Member Function Documentation

◆ curPos()

UInt64 curPos ( ) const
inlineoverridevirtual

returns the current position in the file

Note
OpenMS byte stream interface

Implements InputStream.

References ZipInputStream::file_current_index_.

◆ getIsOpen()

bool getIsOpen ( ) const

returns true if file is open

◆ operator=()

ZipInputStream & operator= ( const ZipInputStream &  stream)
delete

◆ readBytes()

Size readBytes ( unsigned char *const  to_fill,
const Size  max_to_read 
)
overridevirtual

writes bytes into buffer from file

Note
OpenMS byte stream interface
Parameters
[out]to_fillis the buffer which is written to
[in]max_to_readis the size of the buffer
Returns
returns the number of bytes which were actually read

Implements InputStream.

Member Data Documentation

◆ file_current_index_

UInt64 file_current_index_
private

current index of the actual file

Referenced by ZipInputStream::curPos().

◆ zip_

ZipIfstream* zip_ = nullptr
private

pointer to the zip decompression stream