libzipper 1.0.1
Public Member Functions
zipper::Reader Class Reference

Reader supplies input data to the compression/decompression functions. More...

#include <zipper.hh>

Inheritance diagram for zipper::Reader:

List of all members.

Public Member Functions

virtual ~Reader ()
 Reader dtor.
virtual const std::string & getSourceName () const =0
virtual const timeval & getModTime () const =0
virtual zsize_t getSize () const =0
virtual void readData (zsize_t offset, zsize_t bytes, uint8_t *dest) const =0

Detailed Description

Reader supplies input data to the compression/decompression functions.

Normally, an application using libzipper provides the Reader implementation. The implementation could supply data from files, in-memory buffers, or it could be generated on-the-fly.

The Reader implementation must support random access, and must determine at creation time the number of bytes available. The Reader interface is not suitable for use with streaming data.

Definition at line 286 of file zipper.hh.

Member Function Documentation

virtual const timeval& zipper::Reader::getModTime ( ) const [pure virtual]

Return the last-modified timestamp of the data. If the special s_now value is returned, the current time should be used instead.

Implemented in zipper::FileReader.

virtual zsize_t zipper::Reader::getSize ( ) const [pure virtual]

Returns the number of bytes available via readData()

getSize() is stable throughout the lifetime of the Reader instance.

Implemented in zipper::FileReader.

virtual const std::string& zipper::Reader::getSourceName ( ) const [pure virtual]

Returns a name for this source of the data.

For file-based Reader implementations, this would normally be the input filename.

Implemented in zipper::FileReader.

virtual void zipper::Reader::readData ( zsize_t  offset,
zsize_t  bytes,
uint8_t *  dest 
) const [pure virtual]

Copies data into the dest buffer

An exception must be thrown if it is not possible to copy the requested data into the supplied buffer (eg. file IO error).

offset + bytes <= getSize()
offsetNumber of bytes to skip at the front of the data source.
bytesNumber of bytes to copy
destDestination buffer.

Implemented in zipper::FileReader.

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