00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef __PDF_COMMON_FLATE_STREAM_HEADER_INCLUDED__
00027 #define __PDF_COMMON_FLATE_STREAM_HEADER_INCLUDED__
00028
00029 #ifndef __PDF_CORE_STREAM_HEADER_INCLUDED__
00030 #include "core/Stream.hh"
00031 #endif
00032
00033 #include <vector>
00034
00035 namespace pdf { namespace common {
00036
00037 class CFlateStream : public core::CStream
00038 {
00039 private :
00040 std::vector<unsigned char> m_content ;
00041
00042 int m_inflate_level ;
00043
00044 public :
00054 template <typename InputIt>
00055 CFlateStream( InputIt first, InputIt last, int level = 0 )
00056 : m_inflate_level( level )
00057 {
00058 Assign( first, last ) ;
00059 }
00060
00062 CFlateStream( ) ;
00063
00064 ~CFlateStream( ) ;
00065
00066 core::CObject* Dup( ) const ;
00067
00075 template <typename InputIt>
00076 void Assign( InputIt first, InputIt last, int level = 0 )
00077 {
00078
00079 m_content.assign( first, last ) ;
00080
00081
00082 m_inflate_level = level ;
00083 }
00084
00085 protected :
00086 const CStream::CByteVec& GetContent( CStream::CByteVec& output ) const ;
00087 void MakeDictionary( core::CDictionary& dict ) const ;
00088 const CByteVec& Buffer( ) const ;
00089 } ;
00090
00091 } }
00092
00093 #endif