LibreOffice Module hwpfilter (master) 1
|
This controls the HStream given by constructor. More...
#include <hiodev.h>
Public Member Functions | |
HStreamIODev (std::unique_ptr< HStream > stream) | |
virtual | ~HStreamIODev () override |
virtual bool | open () override |
Check whether the stream is available. More... | |
virtual void | flush () override |
If the stream is gzipped, flush the stream. More... | |
virtual bool | state () const override |
Not implemented. More... | |
virtual bool | setCompressed (bool) override |
Set whether the stream is compressed or not. More... | |
virtual bool | read1b (unsigned char &out) override |
Read one byte from stream. More... | |
virtual bool | read1b (char &out) override |
virtual bool | read2b (unsigned short &out) override |
virtual bool | read4b (unsigned int &out) override |
virtual bool | read4b (int &out) override |
virtual size_t | readBlock (void *ptr, size_t size) override |
Read some bytes from stream to given pointer as amount of size. More... | |
virtual size_t | skipBlock (size_t size) override |
Move current pointer of stream as amount of size. More... | |
virtual bool | read2b (unsigned short &out)=0 |
Read 2 bytes from stream. More... | |
size_t | read2b (void *ptr, size_t nmemb) |
Read 2 bytes from stream. More... | |
virtual bool | read4b (unsigned int &out)=0 |
Read 4 bytes from stream. More... | |
virtual bool | read4b (int &out)=0 |
Read 4 bytes from stream. More... | |
size_t | read4b (void *ptr, size_t nmemb) |
Read 4 bytes from stream. More... | |
Public Member Functions inherited from HIODev | |
HIODev () | |
virtual | ~HIODev () |
virtual bool | open ()=0 |
virtual void | flush ()=0 |
virtual bool | state () const =0 |
virtual bool | setCompressed (bool)=0 |
virtual bool | read1b (unsigned char &out)=0 |
virtual bool | read1b (char &out)=0 |
virtual bool | read2b (unsigned short &out)=0 |
virtual bool | read4b (unsigned int &out)=0 |
virtual bool | read4b (int &out)=0 |
virtual size_t | readBlock (void *ptr, size_t size)=0 |
virtual size_t | skipBlock (size_t size)=0 |
size_t | read2b (void *ptr, size_t nmemb) |
size_t | read4b (void *ptr, size_t nmemb) |
Private Member Functions | |
virtual void | init () override |
Initialize this object. More... | |
Private Attributes | |
std::unique_ptr< HStream > | _stream |
gz_stream * | _gzfp |
Additional Inherited Members | |
virtual void | init () |
Protected Attributes inherited from HIODev | |
bool | compressed |
This controls the HStream given by constructor.
Stream IO device
|
explicit |
Definition at line 92 of file hiodev.cxx.
|
overridevirtual |
Definition at line 98 of file hiodev.cxx.
References _gzfp, flush(), and gz_close().
|
overridevirtual |
If the stream is gzipped, flush the stream.
Implements HIODev.
Definition at line 121 of file hiodev.cxx.
References _gzfp, and gz_flush().
Referenced by ~HStreamIODev().
|
overrideprivatevirtual |
Initialize this object.
Reimplemented from HIODev.
Definition at line 108 of file hiodev.cxx.
References _gzfp, and HIODev::compressed.
Referenced by HStreamIODev().
|
overridevirtual |
Check whether the stream is available.
Implements HIODev.
Definition at line 115 of file hiodev.cxx.
References _stream.
|
overridevirtual |
|
overridevirtual |
Read one byte from stream.
Implements HIODev.
Definition at line 155 of file hiodev.cxx.
References _stream, HIODev::compressed, GZREAD, and rBuf.
Referenced by read1b().
|
overridevirtual |
Implements HIODev.
Definition at line 175 of file hiodev.cxx.
References _stream, HIODev::compressed, GZREAD, and rBuf.
|
virtual |
Read 2 bytes from stream.
Implements HIODev.
size_t HIODev::read2b | ( | void * | ptr, |
size_t | nmemb | ||
) |
Read 2 bytes from stream.
Definition at line 62 of file hiodev.cxx.
|
overridevirtual |
|
overridevirtual |
Implements HIODev.
Definition at line 186 of file hiodev.cxx.
References _stream, HIODev::compressed, GZREAD, and rBuf.
Referenced by read4b().
|
virtual |
Read 4 bytes from stream.
Implements HIODev.
size_t HIODev::read4b | ( | void * | ptr, |
size_t | nmemb | ||
) |
Read 4 bytes from stream.
Definition at line 63 of file hiodev.cxx.
References p, HIODev::read2b(), and HIODev::state().
|
overridevirtual |
Read some bytes from stream to given pointer as amount of size.
Implements HIODev.
Definition at line 207 of file hiodev.cxx.
References _stream, HIODev::compressed, count, GZREAD, and size.
|
overridevirtual |
Set whether the stream is compressed or not.
Implements HIODev.
Definition at line 133 of file hiodev.cxx.
References _gzfp, _stream, HIODev::compressed, gz_close(), gz_flush(), and gz_open().
|
overridevirtual |
Move current pointer of stream as amount of size.
Implements HIODev.
Definition at line 217 of file hiodev.cxx.
References _stream, BUFSIZE, HIODev::compressed, GZREAD, rBuf, and size.
|
overridevirtual |
|
private |
Definition at line 79 of file hiodev.h.
Referenced by flush(), init(), setCompressed(), and ~HStreamIODev().
|
private |
Definition at line 78 of file hiodev.h.
Referenced by open(), read1b(), read2b(), read4b(), readBlock(), setCompressed(), and skipBlock().