Chemical Data Processing Library C++ API - Version 1.4.0
Public Types | Public Member Functions | List of all members
CDPL::Util::CompressionOStream< CompAlgo, CharT, TraitsT > Class Template Reference

Output stream wrapper that transparently compresses data and writes it to an underlying sink stream when the wrapper is closed or destroyed. More...

#include <CompressionStreams.hpp>

+ Inheritance diagram for CDPL::Util::CompressionOStream< CompAlgo, CharT, TraitsT >:

Public Types

typedef StreamType::char_type char_type
 The character type of the stream. More...
 
typedef StreamType::traits_type traits_type
 The character traits type of the stream. More...
 
typedef StreamType::int_type int_type
 The integer type used to represent characters and EOF. More...
 
typedef StreamType::pos_type pos_type
 The type used to represent stream positions. More...
 
typedef StreamType::off_type off_type
 The type used to represent stream offsets. More...
 
- Public Types inherited from CDPL::Util::CompressionStreamBase< CompAlgo, std::basic_ostream< char, std::char_traits< char > > >
typedef StreamType::char_type char_type
 The character type of the wrapped stream. More...
 
typedef StreamType::traits_type traits_type
 The character traits type of the wrapped stream. More...
 
typedef StreamType::int_type int_type
 The integer type used to represent characters and EOF. More...
 
typedef StreamType::pos_type pos_type
 The type used to represent stream positions. More...
 
typedef StreamType::off_type off_type
 The type used to represent stream offsets. More...
 
typedef std::basic_istream< char_type, traits_typeIStreamType
 Input-stream type with matching character and traits types. More...
 
typedef std::basic_ostream< char_type, traits_typeOStreamType
 Output-stream type with matching character and traits types. More...
 

Public Member Functions

 CompressionOStream ()
 Constructs the CompressionOStream instance without an associated sink stream. More...
 
 CompressionOStream (StreamType &stream)
 Constructs the CompressionOStream instance and immediately opens it on stream. More...
 
 ~CompressionOStream ()
 Destructor. Flushes any buffered data to the sink stream as compressed output. More...
 
void open (StreamType &stream)
 Opens the compression stream on stream. More...
 
void close ()
 Closes the compression stream and writes the compressed output to the sink stream. More...
 
- Public Member Functions inherited from CDPL::Util::CompressionStreamBase< CompAlgo, std::basic_ostream< char, std::char_traits< char > > >
 CompressionStreamBase ()
 Constructs the CompressionStreamBase instance and installs the temporary-file buffer. More...
 

Additional Inherited Members

- Protected Member Functions inherited from CDPL::Util::CompressionStreamBase< CompAlgo, std::basic_ostream< char, std::char_traits< char > > >
virtual ~CompressionStreamBase ()
 
void closeTmpFile ()
 
void openTmpFile ()
 
void decompInput (IStreamType &is)
 
void compOutput (OStreamType &os)
 

Detailed Description

template<CompressionAlgo CompAlgo, typename CharT = char, typename TraitsT = std::char_traits<CharT>>
class CDPL::Util::CompressionOStream< CompAlgo, CharT, TraitsT >

Output stream wrapper that transparently compresses data and writes it to an underlying sink stream when the wrapper is closed or destroyed.

Template Parameters
CompAlgoThe compression algorithm identifier (see Util::CompressionAlgo).
CharTThe character type of the stream.
TraitsTThe character traits type of the stream.

Member Typedef Documentation

◆ char_type

template<CompressionAlgo CompAlgo, typename CharT = char, typename TraitsT = std::char_traits<CharT>>
typedef StreamType::char_type CDPL::Util::CompressionOStream< CompAlgo, CharT, TraitsT >::char_type

The character type of the stream.

◆ traits_type

template<CompressionAlgo CompAlgo, typename CharT = char, typename TraitsT = std::char_traits<CharT>>
typedef StreamType::traits_type CDPL::Util::CompressionOStream< CompAlgo, CharT, TraitsT >::traits_type

The character traits type of the stream.

◆ int_type

template<CompressionAlgo CompAlgo, typename CharT = char, typename TraitsT = std::char_traits<CharT>>
typedef StreamType::int_type CDPL::Util::CompressionOStream< CompAlgo, CharT, TraitsT >::int_type

The integer type used to represent characters and EOF.

◆ pos_type

template<CompressionAlgo CompAlgo, typename CharT = char, typename TraitsT = std::char_traits<CharT>>
typedef StreamType::pos_type CDPL::Util::CompressionOStream< CompAlgo, CharT, TraitsT >::pos_type

The type used to represent stream positions.

◆ off_type

template<CompressionAlgo CompAlgo, typename CharT = char, typename TraitsT = std::char_traits<CharT>>
typedef StreamType::off_type CDPL::Util::CompressionOStream< CompAlgo, CharT, TraitsT >::off_type

The type used to represent stream offsets.

Constructor & Destructor Documentation

◆ CompressionOStream() [1/2]

template<CDPL::Util::CompressionAlgo CompAlgo, typename CharT , typename TraitsT >
CDPL::Util::CompressionOStream< CompAlgo, CharT, TraitsT >::CompressionOStream

Constructs the CompressionOStream instance without an associated sink stream.

◆ CompressionOStream() [2/2]

template<CDPL::Util::CompressionAlgo CompAlgo, typename CharT , typename TraitsT >
CDPL::Util::CompressionOStream< CompAlgo, CharT, TraitsT >::CompressionOStream ( StreamType &  stream)

Constructs the CompressionOStream instance and immediately opens it on stream.

Parameters
streamThe sink stream that will receive the compressed output.

◆ ~CompressionOStream()

template<CDPL::Util::CompressionAlgo CompAlgo, typename CharT , typename TraitsT >
CDPL::Util::CompressionOStream< CompAlgo, CharT, TraitsT >::~CompressionOStream

Destructor. Flushes any buffered data to the sink stream as compressed output.

Member Function Documentation

◆ open()

template<CDPL::Util::CompressionAlgo CompAlgo, typename CharT , typename TraitsT >
void CDPL::Util::CompressionOStream< CompAlgo, CharT, TraitsT >::open ( StreamType &  stream)

Opens the compression stream on stream.

Parameters
streamThe sink stream that will receive the compressed output.

◆ close()

template<CDPL::Util::CompressionAlgo CompAlgo, typename CharT , typename TraitsT >
void CDPL::Util::CompressionOStream< CompAlgo, CharT, TraitsT >::close

Closes the compression stream and writes the compressed output to the sink stream.


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