Rosetta 3.3
Public Types | Public Member Functions
zlib_stream::basic_unzip_streambuf< Elem, Tr, ElemA, ByteT, ByteAT > Class Template Reference

A stream decorator that takes compressed input and unzips it to a istream. More...

#include <zipstream.hpp>

Inheritance diagram for zlib_stream::basic_unzip_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >:
Inheritance graph
[legend]
Collaboration diagram for zlib_stream::basic_unzip_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef std::basic_streambuf
< Elem, Tr > 
basic_streambuf_type
typedef std::basic_istream
< Elem, Tr > & 
istream_reference
typedef Elem char_type
typedef ElemA char_allocator_type
typedef ByteT byte_type
typedef ByteAT byte_allocator_type
typedef byte_typebyte_buffer_type
typedef std::vector< byte_type,
byte_allocator_type
byte_vector_type
typedef std::vector< char_type,
char_allocator_type
char_vector_type
typedef Tr::int_type int_type

Public Member Functions

 basic_unzip_streambuf (istream_reference istream_, size_t window_size_, size_t read_buffer_size_, size_t input_buffer_size_)
 Construct an unzip stream.
 ~basic_unzip_streambuf ()
int_type underflow ()
istream_reference get_istream ()
 returns the compressed input istream
z_stream & get_zip_stream ()
 returns the zlib stream structure
int get_zerr () const
 returns the latest zlib error state
uLong get_crc () const
 returns the crc of the uncompressed data so far
uLong get_out_size () const
 returns the number of uncompressed bytes
uLong get_in_size () const
 returns the number of read compressed bytes

Detailed Description

template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
class zlib_stream::basic_unzip_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >

A stream decorator that takes compressed input and unzips it to a istream.

Note:
The class wraps up the deflate method of the zlib library 1.1.4 http://www.gzip.org/zlib/

Member Typedef Documentation

template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
typedef std::basic_streambuf< Elem, Tr > zlib_stream::basic_unzip_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::basic_streambuf_type
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
typedef ByteAT zlib_stream::basic_unzip_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::byte_allocator_type
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
typedef byte_type* zlib_stream::basic_unzip_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::byte_buffer_type
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
typedef ByteT zlib_stream::basic_unzip_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::byte_type
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
typedef std::vector< byte_type, byte_allocator_type > zlib_stream::basic_unzip_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::byte_vector_type
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
typedef ElemA zlib_stream::basic_unzip_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::char_allocator_type
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
typedef Elem zlib_stream::basic_unzip_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::char_type
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
typedef std::vector< char_type, char_allocator_type > zlib_stream::basic_unzip_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::char_vector_type
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
typedef Tr::int_type zlib_stream::basic_unzip_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::int_type
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
typedef std::basic_istream< Elem, Tr >& zlib_stream::basic_unzip_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::istream_reference

Constructor & Destructor Documentation

template<typename Elem , typename Tr , typename ElemA , typename ByteT , typename ByteAT >
zlib_stream::basic_unzip_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::basic_unzip_streambuf ( istream_reference  istream_,
size_t  window_size_,
size_t  read_buffer_size_,
size_t  input_buffer_size_ 
)

Construct an unzip stream.

Note:
More info on the following parameters can be found in the zlib documentation
template<typename Elem , typename Tr , typename ElemA , typename ByteT , typename ByteAT >
zlib_stream::basic_unzip_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::~basic_unzip_streambuf ( )

Member Function Documentation

template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
uLong zlib_stream::basic_unzip_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::get_crc ( ) const [inline]

returns the crc of the uncompressed data so far

template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
uLong zlib_stream::basic_unzip_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::get_in_size ( ) const [inline]

returns the number of read compressed bytes

template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
istream_reference zlib_stream::basic_unzip_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::get_istream ( ) [inline]

returns the compressed input istream

template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
uLong zlib_stream::basic_unzip_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::get_out_size ( ) const [inline]

returns the number of uncompressed bytes

template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
int zlib_stream::basic_unzip_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::get_zerr ( ) const [inline]

returns the latest zlib error state

template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
z_stream& zlib_stream::basic_unzip_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::get_zip_stream ( ) [inline]

returns the zlib stream structure

template<typename Elem , typename Tr , typename ElemA , typename ByteT , typename ByteAT >
basic_unzip_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::int_type zlib_stream::basic_unzip_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::underflow ( )

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines