the zlib namespace contains all zlib related classes and functions.
|
|
this is just a short cut for unsigned char vectors
|
|
||||||||||||||||
|
compress a vector. the compressed output is placed in another vector.
00076 {
00077 assert( !input.empty( ) ) ;
00078
00079 Compress( &input[0], input.size( ), output, level ) ;
00080 }
|
|
||||||||||||
|
compress a vector in-place. this function is provided for convinience.
|
|
||||||||||||||||||||
|
compress a raw buffer into a vector. it use a vector as output so that we can save a output size argument.
00097 {
00098 assert( buffer != 0 ) ;
00099 assert( size > 0 ) ;
00100
00101 // double original size must be enough
00102 CBuffer result( size * 2 ) ;
00103
00104 unsigned long out_len = result.size( ) ;
00105 int err = compress2( &result[0], &out_len,
00106 static_cast<const unsigned char*>( buffer ),
00107 size, level ) ;
00108
00109 if ( err != Z_OK )
00110 throw CError( err ) ;
00111 else
00112 {
00113 result.resize( out_len ) ;
00114 result.swap( output ) ;
00115 }
00116 }
|
1.2.16