LibreOffice Module hwpfilter (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
HStreamIODev Class Referencefinal

This controls the HStream given by constructor. More...

#include <hiodev.h>

Inheritance diagram for HStreamIODev:
[legend]
Collaboration diagram for HStreamIODev:
[legend]

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
 

Detailed Description

This controls the HStream given by constructor.

Stream IO device

Definition at line 74 of file hiodev.h.

Constructor & Destructor Documentation

◆ HStreamIODev()

HStreamIODev::HStreamIODev ( std::unique_ptr< HStream stream)
explicit

Definition at line 92 of file hiodev.cxx.

References init(), and stream.

◆ ~HStreamIODev()

HStreamIODev::~HStreamIODev ( )
overridevirtual

Definition at line 98 of file hiodev.cxx.

References _gzfp, flush(), and gz_close().

Member Function Documentation

◆ flush()

void HStreamIODev::flush ( )
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().

◆ init()

void HStreamIODev::init ( )
overrideprivatevirtual

Initialize this object.

Reimplemented from HIODev.

Definition at line 108 of file hiodev.cxx.

References _gzfp, and HIODev::compressed.

Referenced by HStreamIODev().

◆ open()

bool HStreamIODev::open ( )
overridevirtual

Check whether the stream is available.

Implements HIODev.

Definition at line 115 of file hiodev.cxx.

References _stream.

◆ read1b() [1/2]

bool HStreamIODev::read1b ( char &  out)
overridevirtual

Implements HIODev.

Definition at line 166 of file hiodev.cxx.

References read1b().

◆ read1b() [2/2]

bool HStreamIODev::read1b ( unsigned char &  out)
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().

◆ read2b() [1/3]

bool HStreamIODev::read2b ( unsigned short &  out)
overridevirtual

Implements HIODev.

Definition at line 175 of file hiodev.cxx.

References _stream, HIODev::compressed, GZREAD, and rBuf.

◆ read2b() [2/3]

virtual bool HIODev::read2b ( unsigned short &  out)
virtual

Read 2 bytes from stream.

Implements HIODev.

◆ read2b() [3/3]

size_t HIODev::read2b ( void *  ptr,
size_t  nmemb 
)

Read 2 bytes from stream.

Definition at line 62 of file hiodev.cxx.

◆ read4b() [1/5]

bool HStreamIODev::read4b ( int out)
overridevirtual

Implements HIODev.

Definition at line 198 of file hiodev.cxx.

References read4b().

◆ read4b() [2/5]

virtual bool HIODev::read4b ( int out)
virtual

Read 4 bytes from stream.

Implements HIODev.

◆ read4b() [3/5]

bool HStreamIODev::read4b ( unsigned int out)
overridevirtual

Implements HIODev.

Definition at line 186 of file hiodev.cxx.

References _stream, HIODev::compressed, GZREAD, and rBuf.

Referenced by read4b().

◆ read4b() [4/5]

virtual bool HIODev::read4b ( unsigned int out)
virtual

Read 4 bytes from stream.

Implements HIODev.

◆ read4b() [5/5]

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().

◆ readBlock()

size_t HStreamIODev::readBlock ( void *  ptr,
size_t  size 
)
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.

◆ setCompressed()

bool HStreamIODev::setCompressed ( bool  flag)
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().

◆ skipBlock()

size_t HStreamIODev::skipBlock ( size_t  size)
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.

◆ state()

bool HStreamIODev::state ( ) const
overridevirtual

Not implemented.

Implements HIODev.

Definition at line 127 of file hiodev.cxx.

Member Data Documentation

◆ _gzfp

gz_stream* HStreamIODev::_gzfp
private

Definition at line 79 of file hiodev.h.

Referenced by flush(), init(), setCompressed(), and ~HStreamIODev().

◆ _stream

std::unique_ptr<HStream> HStreamIODev::_stream
private

Definition at line 78 of file hiodev.h.

Referenced by open(), read1b(), read2b(), read4b(), readBlock(), setCompressed(), and skipBlock().


The documentation for this class was generated from the following files: