2019-07-28 10:31:56 +08:00
|
|
|
|
#pragma once
|
2017-06-02 14:47:24 +08:00
|
|
|
|
#include "../acl_cpp_define.hpp"
|
|
|
|
|
#include "pipe_stream.hpp"
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
typedef struct z_stream_s z_stream;
|
|
|
|
|
|
|
|
|
|
namespace acl {
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͷ<EFBFBD><EFBFBD>壬<EFBFBD>ü<EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD>ٶȼ<EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD>ȵ<EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD>ʽ
|
|
|
|
|
* <EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD>ֵԽ<EFBFBD>ߣ<EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD>Ȼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD>ٶȻ<EFBFBD>Խ<EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
typedef enum
|
|
|
|
|
{
|
2019-07-28 10:31:56 +08:00
|
|
|
|
zlib_default = -1, // ȱʡ<C8B1><CAA1>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD>
|
|
|
|
|
zlib_level0 = 0, // <20><><EFBFBD>͵<EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD>ȣ<EFBFBD><C8A3><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD>Dz<EFBFBD>ѹ<EFBFBD><D1B9>
|
|
|
|
|
zlib_best_speed = 1, // ѹ<><D1B9><EFBFBD>ٶ<EFBFBD><D9B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
zlib_level1 = zlib_best_speed,
|
|
|
|
|
zlib_level2 = 2,
|
|
|
|
|
zlib_level3 = 3,
|
|
|
|
|
zlib_level4 = 4,
|
|
|
|
|
zlib_level5 = 5,
|
|
|
|
|
zlib_level6 = 6,
|
|
|
|
|
zlib_level7 = 7,
|
|
|
|
|
zlib_level8 = 8,
|
2019-07-28 10:31:56 +08:00
|
|
|
|
zlib_best_compress = 9, // <20><><EFBFBD>ߵ<EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD>ȣ<EFBFBD><C8A3><EFBFBD><EFBFBD>͵<EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD>ٶ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
zlib_level9 = zlib_best_compress
|
|
|
|
|
} zlib_level_t;
|
|
|
|
|
|
2015-08-18 20:58:56 +08:00
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD>ֵԽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD>Ч<EFBFBD><EFBFBD>Խ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>Խ<EFBFBD>࣬
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> HTTP ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䣬<EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Щֵ<EFBFBD>ĸ<EFBFBD>ֵ<EFBFBD><EFBFBD>-zlib_wbits_t
|
2015-08-18 20:58:56 +08:00
|
|
|
|
*/
|
|
|
|
|
enum
|
|
|
|
|
{
|
|
|
|
|
zlib_wbits_8 = 8,
|
|
|
|
|
zlib_wbits_9 = 9,
|
|
|
|
|
zlib_wbits_10 = 10,
|
|
|
|
|
zlib_wbits_11 = 11,
|
|
|
|
|
zlib_wbits_12 = 12,
|
|
|
|
|
zlib_wbits_13 = 13,
|
|
|
|
|
zlib_wbits_14 = 14,
|
|
|
|
|
zlib_wbits_15 = 15,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԣ<EFBFBD>ֵԽ<EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>Խ<EFBFBD><EFBFBD>
|
2015-08-18 20:58:56 +08:00
|
|
|
|
*/
|
|
|
|
|
typedef enum
|
|
|
|
|
{
|
|
|
|
|
zlib_mlevel_1 = 1,
|
|
|
|
|
zlib_mlevel_2 = 2,
|
|
|
|
|
zlib_mlevel_3 = 3,
|
|
|
|
|
zlib_mlevel_4 = 4,
|
|
|
|
|
zlib_mlevel_5 = 5,
|
|
|
|
|
zlib_mlevel_6 = 6,
|
|
|
|
|
zlib_mlevel_7 = 7,
|
|
|
|
|
zlib_mlevel_8 = 8,
|
|
|
|
|
zlib_mlevel_9 = 9,
|
|
|
|
|
} zlib_mlevel_t;
|
|
|
|
|
|
2014-11-19 00:25:21 +08:00
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еĻ<EFBFBD><EFBFBD><EFBFBD>ģʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˢ<EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>˻<EFBFBD><EFBFBD>ñȽϸߵ<EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD>ȣ<EFBFBD>Ӧ<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD> zlib_flush_off <EFBFBD><EFBFBD>ʽ
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
typedef enum
|
|
|
|
|
{
|
2019-07-28 10:31:56 +08:00
|
|
|
|
zlib_flush_off = 0, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˢ<EFBFBD><CBA2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
zlib_flush_partial = 1, // ˢ<>²<EFBFBD><C2B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
zlib_flush_sync = 2, // ͬ<><CDAC>ˢ<EFBFBD><CBA2>
|
|
|
|
|
zlib_flush_full = 3, // <20><>ȫˢ<C8AB><CBA2>
|
|
|
|
|
zlib_flush_finish = 4 // <20><>ȫˢ<C8AB>²<EFBFBD>ֹͣѹ<D6B9><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
} zlib_flush_t;
|
|
|
|
|
|
|
|
|
|
class string;
|
|
|
|
|
|
|
|
|
|
class ACL_CPP_API zlib_stream : public pipe_stream
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
zlib_stream();
|
|
|
|
|
~zlib_stream();
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽѹ<EFBFBD><EFBFBD>
|
|
|
|
|
* @param in {const char*} Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param len {int} Դ<EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param out {string*} <EFBFBD>洢ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param level {zlib_level_t} ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>𣬼<EFBFBD><EFBFBD><EFBFBD>Խ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Խ<EFBFBD>ߣ<EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD>ٶ<EFBFBD>Խ<EFBFBD><EFBFBD>
|
|
|
|
|
* @return {bool} ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
bool zlib_compress(const char* in, int len, string* out,
|
|
|
|
|
zlib_level_t level = zlib_default);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD>
|
|
|
|
|
* @param in {const char*} Դѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param len {int} Դ<EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param out {string*} <EFBFBD>洢<EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param have_zlib_header {bool} <EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD> zlib_header ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* HTTP <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ý<EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>Ϊ false
|
|
|
|
|
* @param wsize {int} <EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еĻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>С
|
|
|
|
|
* @return {bool} <EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
bool zlib_uncompress(const char* in, int len, string* out,
|
|
|
|
|
bool have_zlib_header = true, int wsize = 15);
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>ʽѹ<CABD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
//
|
|
|
|
|
///////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD>ʼѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̣<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD>
|
|
|
|
|
* zip_begin->zip_update->zip_finish<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><EFBFBD>κ<EFBFBD>һ<EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>õ<EFBFBD><EFBFBD><EFBFBD> zip_reset
|
|
|
|
|
* @param level {zlib_level_t} ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>𣬼<EFBFBD><EFBFBD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>Խ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>ʹ<EFBFBD><EFBFBD>Խ<EFBFBD><EFBFBD>
|
|
|
|
|
* @return {bool} ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܵ<EFBFBD>ԭ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>
|
|
|
|
|
* Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IJ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
2015-08-18 20:58:56 +08:00
|
|
|
|
bool zip_begin(zlib_level_t level = zlib_default,
|
|
|
|
|
int wbits = zlib_wbits_15,
|
|
|
|
|
zlib_mlevel_t mlevel = zlib_mlevel_9);
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* ѭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ô˺<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD>ݽ<EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD>
|
|
|
|
|
* @param in {const char*} Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param len {int} Դ<EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param out {string*} <EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ú<EFBFBD><E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D><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݻ<EFBFBD><EFBFBD>巽ʽ
|
|
|
|
|
* zlib_flush_off: <EFBFBD><EFBFBD><EFBFBD>ݽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* zlib <EFBFBD>Ȿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˢ<EFBFBD>µķ<EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ýϸߵ<EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* zlib_flush_partial: <EFBFBD><EFBFBD><EFBFBD>ݽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܻᲿ<EFBFBD><EFBFBD>ˢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* zlib_flush_sync: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><EFBFBD>ˢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* zlib_flush_full: <EFBFBD><EFBFBD> zlib <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݽ<EFBFBD><EFBFBD><EFBFBD>ȫ<EFBFBD><EFBFBD>ˢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* zlib_flush_finish: <EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬʱ<EFBFBD>Ὣ
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>н<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>ò<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>ã<EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> zip_finish <EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еĻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {bool} ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>ʧ<EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
bool zip_update(const char* in, int len, string* out,
|
|
|
|
|
zlib_flush_t flag = zlib_flush_off);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̽<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param out {string} <EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ὣ zlib <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵķ<EFBFBD>ʽ<EFBFBD><EFBFBD>ˢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {bool} <EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
bool zip_finish(string* out);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>ֻ<EFBFBD>е<EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̳<EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>Ż<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {bool} <EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
bool zip_reset();
|
|
|
|
|
|
2015-08-22 18:05:46 +08:00
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>п<EFBFBD>ʹ<EFBFBD>ô˺<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD> crc32 У<EFBFBD><EFBFBD>ֵ
|
|
|
|
|
* @param n {unsigned} <EFBFBD>ϴμ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>д 0
|
|
|
|
|
* @param buf {const void*} <EFBFBD><EFBFBD>ҪУ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>ʱд NULL
|
|
|
|
|
* @param dlen {size_t} buf <EFBFBD><EFBFBD><EFBFBD>ݵij<EFBFBD><EFBFBD>ȣ<EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>ʱд 0
|
|
|
|
|
* @return {unsinged} <EFBFBD><EFBFBD><EFBFBD>μ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
2015-08-22 18:05:46 +08:00
|
|
|
|
*/
|
|
|
|
|
unsigned crc32_update(unsigned n, const void* buf, size_t dlen);
|
|
|
|
|
|
2014-11-19 00:25:21 +08:00
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̣<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD>
|
|
|
|
|
* unzip_begin->unzip_update->unzip_finish<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><EFBFBD>κ<EFBFBD>һ<EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>õ<EFBFBD><EFBFBD><EFBFBD> unzip_reset
|
|
|
|
|
* @param have_zlib_header {bool} <EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD> zlib_header ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* HTTP <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ý<EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>Ϊ false
|
|
|
|
|
* @param wsize {int} <EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еĻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>С
|
|
|
|
|
* @return {bool} <EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܵ<EFBFBD>ԭ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>
|
|
|
|
|
* Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IJ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
bool unzip_begin(bool have_zlib_header = true, int wsize = 15);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* ѭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ô˺<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD>ݽ<EFBFBD><EFBFBD>н<EFBFBD>ѹ<EFBFBD><EFBFBD>
|
|
|
|
|
* @param in {const char*} ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param len {int} Դ<EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param out {string*} <EFBFBD>û<EFBFBD><EFBFBD><EFBFBD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D><EFBFBD><EFBFBD>
|
|
|
|
|
* @param flag {zlib_flush_t} <EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݻ<EFBFBD><EFBFBD>巽ʽ
|
|
|
|
|
* zlib_flush_off: <EFBFBD><EFBFBD><EFBFBD>ݽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* zlib <EFBFBD>Ȿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˢ<EFBFBD>µķ<EFBFBD>ʽ
|
|
|
|
|
* zlib_flush_partial: <EFBFBD><EFBFBD><EFBFBD>ݽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܻᲿ<EFBFBD><EFBFBD>ˢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* zlib_flush_sync: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><EFBFBD>ˢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* zlib_flush_full: <EFBFBD><EFBFBD> zlib <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݽ<EFBFBD><EFBFBD><EFBFBD>ȫ<EFBFBD><EFBFBD>ˢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* zlib_flush_finish: <EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬʱ<EFBFBD>Ὣ
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>н<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>ò<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>ã<EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> zip_finish <EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еĻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {bool} <EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>ʧ<EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
bool unzip_update(const char* in, int len, string* out,
|
|
|
|
|
zlib_flush_t flag = zlib_flush_off);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̽<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param out {string} <EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ὣ zlib <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵķ<EFBFBD>ʽ<EFBFBD><EFBFBD>ˢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {bool} <EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
bool unzip_finish(string* out);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>ֻ<EFBFBD>е<EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̳<EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>Ż<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {bool} <EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
bool unzip_reset();
|
|
|
|
|
|
2015-08-18 20:58:56 +08:00
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>ǰ<EFBFBD><EFBFBD> zstream <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-08-18 20:58:56 +08:00
|
|
|
|
* @return {z_stream*}
|
|
|
|
|
*/
|
|
|
|
|
z_stream* get_zstream() const
|
|
|
|
|
{
|
|
|
|
|
return zstream_;
|
|
|
|
|
}
|
|
|
|
|
|
2015-08-22 18:05:46 +08:00
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD>̬<EFBFBD><EFBFBD><EFBFBD>ط<EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>̬<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ô˺<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD>̬<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>ȫ·<EFBFBD><EFBFBD>
|
2015-08-22 18:05:46 +08:00
|
|
|
|
*/
|
|
|
|
|
static void set_loadpath(const char* path);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD>̬<EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD>̬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȫ·<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD>̬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȫ·<EFBFBD><EFBFBD>
|
|
|
|
|
* @return {const char*} <EFBFBD><EFBFBD>δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD> NULL
|
2015-08-22 18:05:46 +08:00
|
|
|
|
*/
|
|
|
|
|
static const char* get_loadpath();
|
|
|
|
|
|
2014-11-19 00:25:21 +08:00
|
|
|
|
///////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
bool pipe_zip_begin(zlib_level_t level = zlib_default,
|
|
|
|
|
zlib_flush_t flag = zlib_flush_off);
|
|
|
|
|
bool pipe_unzip_begin(zlib_flush_t flag = zlib_flush_off);
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// pipe_stream <20>麯<EFBFBD><E9BAAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
virtual int push_pop(const char* in, size_t len,
|
|
|
|
|
string* out, size_t max = 0);
|
|
|
|
|
virtual int pop_end(string* out, size_t max = 0);
|
|
|
|
|
virtual void clear();
|
2015-08-18 20:58:56 +08:00
|
|
|
|
|
2014-11-19 00:25:21 +08:00
|
|
|
|
private:
|
|
|
|
|
z_stream* zstream_;
|
|
|
|
|
bool finished_;
|
|
|
|
|
bool is_compress_;
|
|
|
|
|
zlib_flush_t flush_;
|
|
|
|
|
|
|
|
|
|
bool update(int (*func)(z_stream*, int), zlib_flush_t flag,
|
|
|
|
|
const char* in, int len, string* out);
|
|
|
|
|
bool flush_out(int (*func)(z_stream*, int),
|
|
|
|
|
zlib_flush_t flag, string* out);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace acl
|