ZFFramework
 
Loading...
Searching...
No Matches
ZFCompress.h
Go to the documentation of this file.
1
5
6#ifndef _ZFI_ZFCompress_h_
7#define _ZFI_ZFCompress_h_
8
9#include "ZFAlgorithmDef.h"
11
16 ZFENUM_VALUE(NoCompress)
17 ZFENUM_VALUE(BestSpeed)
18 ZFENUM_VALUE(GoodSpeed)
20 ZFENUM_VALUE(GoodCompress)
21 ZFENUM_VALUE(BestCompress)
23 ZFENUM_VALUE_REGISTER(NoCompress)
24 ZFENUM_VALUE_REGISTER(BestSpeed)
25 ZFENUM_VALUE_REGISTER(GoodSpeed)
27 ZFENUM_VALUE_REGISTER(GoodCompress)
28 ZFENUM_VALUE_REGISTER(BestCompress)
31
32// ============================================================
33// base api
76zfclass ZFLIB_ZFAlgorithm ZFCompress : zfextend ZFObject {
77 ZFOBJECT_DECLARE(ZFCompress, ZFObject)
78
79public:
82 , ZFMP_IN(const ZFOutput &, outputZip)
84 )
89
92 , ZFMP_IN(const zfstring &, filePathInZip)
93 , ZFMP_IN_OUT(const ZFInput &, inputRaw)
94 )
97 , ZFMP_IN(const zfstring &, filePathInZip)
98 )
101 , ZFMP_IN(const zfstring &, filePathInZip)
105 , ZFMP_IN(const zfstring &, filePathInZipFrom)
106 , ZFMP_IN(const zfstring &, filePathInZipTo)
107 , ZFMP_IN_OPT(zfbool, isForce, zftrue)
109
110protected:
113 ZFMP_IN(const ZFOutput &, outputZip)
114 , ZFMP_IN_OPT(ZFCompressLevel, compressLevel, v_ZFCompressLevel::EnumDefault())
116protected:
118 virtual void objectOnInit(void);
120 virtual void objectOnDeallocPrepare(void);
121private:
122 void *d;
123};
124
126zfclass ZFLIB_ZFAlgorithm ZFDecompress : zfextend ZFObject {
127 ZFOBJECT_DECLARE(ZFDecompress, ZFObject)
128
129public:
132 , ZFMP_IN_OUT(const ZFInput &, inputZip)
138
141 , ZFMP_IN_OUT(const ZFOutput &, outputRaw)
142 , ZFMP_IN(zfindex, fileIndexInZip)
146 , ZFMP_IN_OUT(const ZFOutput &, outputRaw)
147 , ZFMP_IN(const zfstring &, filePathInZip)
149
160 , ZFMP_IN(const zfstring &, filePathInZip)
164 , ZFMP_IN(zfindex, fileIndexInZip)
168 , ZFMP_IN_OUT(zfstring &, ret)
169 , ZFMP_IN(zfindex, fileIndexInZip)
173 , ZFMP_IN(zfindex, fileIndexInZip)
175
179 , ZFMP_IN(const zfstring &, filePathInZip)
189
190protected:
193 ZFMP_IN_OUT(const ZFInput &, inputZip)
195protected:
197 virtual void objectOnInit(void);
199 virtual void objectOnDeallocPrepare(void);
200private:
201 void *d;
202};
203
204// ============================================================
205// util
208 , ZFMP_IN_OUT(const ZFOutput &, outputZip)
209 , ZFMP_IN_OUT(const ZFInput &, inputRaw)
210 , ZFMP_IN_OPT(const zfstring &, filePathInZip, zftext("content"))
211 , ZFMP_IN_OPT(ZFCompressLevel, compressLevel, v_ZFCompressLevel::EnumDefault())
215 , ZFMP_IN_OUT(const ZFOutput &, outputRaw)
216 , ZFMP_IN_OUT(const ZFInput &, inputZip)
217 , ZFMP_IN_OPT(const zfstring &, filePathInZip, zftext("content"))
219
222 , ZFMP_IN_OUT(const ZFOutput &, outputZip)
223 , ZFMP_IN(const ZFPathInfo &, inputPathInfo)
224 , ZFMP_IN_OPT(const zfstring &, filePathInZip, zftext("content"))
225 , ZFMP_IN_OPT(ZFCompressLevel, compressLevel, v_ZFCompressLevel::EnumDefault())
229 , ZFMP_IN(const ZFPathInfo &, outputPathInfo)
230 , ZFMP_IN_OUT(const ZFInput &, inputZip)
232
234#endif // #ifndef _ZFI_ZFCompress_h_
235
global header for ZFAlgorithm module
#define ZFLIB_ZFAlgorithm
used to export symbols
Definition ZFAlgorithmDef.h:14
v_ZFCompressLevel::ZFEnumType ZFCompressLevel
see v_ZFCompressLevel
Definition ZFCompress.h:29
ZFLIB_ZFAlgorithm zfbool ZFDecompressDir(const ZFPathInfo &outputPathInfo, const ZFInput &inputZip)
see ZFCompress
ZFLIB_ZFAlgorithm zfbool ZFDecompressContent(const ZFOutput &outputRaw, const ZFInput &inputZip, const zfstring &filePathInZip=(zfstring::shared("content")))
see ZFCompress
ZFLIB_ZFAlgorithm zfbool ZFCompressContent(const ZFOutput &outputZip, const ZFInput &inputRaw, const zfstring &filePathInZip=(zfstring::shared("content")), ZFCompressLevel compressLevel=(v_ZFCompressLevel::EnumDefault()))
see ZFCompress
ZFLIB_ZFAlgorithm zfbool ZFCompressDir(const ZFOutput &outputZip, const ZFPathInfo &inputPathInfo, const zfstring &filePathInZip=(zfstring::shared("content")), ZFCompressLevel compressLevel=(v_ZFCompressLevel::EnumDefault()))
see ZFCompress
#define zfextend
dummy macro shows class inherit from another
Definition ZFCoreTypeDef_ClassType.h:53
#define zfoverride
dummy macro shows that method override parent's method
Definition ZFCoreTypeDef_ClassType.h:58
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
_ZFT_t_zfindex zfindex
similar to size_t, used for index and size only
Definition ZFCoreTypeDef_CoreType.h:154
#define zftrue
bool true type
Definition ZFCoreTypeDef_CoreType.h:107
zft_zfstring< zfchar > zfstring
see zft_zfstring
Definition ZFCoreTypeDef_StringType.h:15
#define ZFENUM_SEPARATOR()
see ZFENUM_BEGIN
Definition ZFEnumDeclare.h:158
#define ZFENUM_VALUE_REGISTER(Value)
see ZFENUM_BEGIN
Definition ZFEnumDeclare.h:168
#define ZFENUM_REG(ZFLIB_, EnumName,...)
see ZFENUM_BEGIN
Definition ZFEnumDeclare.h:186
#define ZFENUM_END_WITH_DEFAULT(ZFLIB_, EnumName, defaultEnum)
see ZFENUM_BEGIN
Definition ZFEnumDeclare.h:175
#define ZFENUM_VALUE(Value)
see ZFENUM_BEGIN
Definition ZFEnumDeclare.h:151
#define ZFENUM_BEGIN(ZFLIB_, EnumName)
macros to define reflectable enum type
Definition ZFEnumDeclare.h:147
#define ZFMP_IN_OUT(ParamType, paramName)
see ZFMP_IN
Definition ZFMethod.h:117
#define ZFMP_IN_OPT(ParamType, paramName, DefaultValue)
see ZFMP_IN
Definition ZFMethod.h:108
#define ZFMP_IN(ParamType, paramName)
macro to wrap param types for ZFMETHOD_INLINE_0 series
Definition ZFMethod.h:105
#define ZFMETHOD_DECLARE_0(ReturnType, MethodName)
see ZFMethod
Definition ZFMethodDeclare.h:693
#define ZFMETHOD_DECLARE_2(ReturnType, MethodName, ZFMP_0, ZFMP_1)
see ZFMethod
Definition ZFMethodDeclare.h:1025
#define ZFMETHOD_DECLARE_3(ReturnType, MethodName, ZFMP_0, ZFMP_1, ZFMP_2)
see ZFMethod
Definition ZFMethodDeclare.h:1206
#define ZFMETHOD_DECLARE_1(ReturnType, MethodName, ZFMP_0)
see ZFMethod
Definition ZFMethodDeclare.h:854
#define ZFMETHOD_FUNC_DECLARE_2(ZFLIB_, ReturnType, MethodName, ZFMP_0, ZFMP_1)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:763
#define ZFMETHOD_FUNC_DECLARE_3(ZFLIB_, ReturnType, MethodName, ZFMP_0, ZFMP_1, ZFMP_2)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:910
#define ZFMETHOD_FUNC_DECLARE_4(ZFLIB_, ReturnType, MethodName, ZFMP_0, ZFMP_1, ZFMP_2, ZFMP_3)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:1065
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
#define zfclass
same as class, shows that this class is a ZFObject type
Definition ZFObjectClassTypeFwd.h:38
#define ZFOBJECT_ON_INIT_DECLARE_2(ZFMP_0, ZFMP_1)
see ZFOBJECT_ON_INIT_INLINE_1
Definition ZFObjectDeclare.h:290
#define ZFOBJECT_ON_INIT_DECLARE_1(ZFMP_0)
see ZFOBJECT_ON_INIT_INLINE_1
Definition ZFObjectDeclare.h:263
#define ZFOBJECT_DECLARE(ChildClass, SuperClass,...)
necessary for every class inherit from ZFObject
Definition ZFObjectDeclare.h:126
virtual void objectOnDeallocPrepare(void)
called before objectOnDealloc, safe to call virtual functions here
virtual zfbool createDir(const zfstring &filePathInZip)
see ZFCompress
virtual zfbool open(const ZFOutput &outputZip, ZFCompressLevel compressLevel=(v_ZFCompressLevel::EnumDefault()))
see ZFCompress
virtual zfbool remove(const zfstring &filePathInZip)
see ZFCompress
virtual zfbool close()
see ZFCompress
virtual zfbool valid()
see ZFCompress
virtual void objectOnInit(const ZFOutput &outputZip, ZFCompressLevel compressLevel=(v_ZFCompressLevel::EnumDefault()))
see ZFCompress
virtual zfbool output(const zfstring &filePathInZip, const ZFInput &inputRaw)
see ZFCompress
virtual zfbool move(const zfstring &filePathInZipFrom, const zfstring &filePathInZipTo, zfbool isForce=(_ZFT_t_zftrue))
see ZFCompress
virtual void objectOnInit(const ZFInput &inputZip)
see ZFCompress
virtual zfbool output(const ZFOutput &outputRaw, const zfstring &filePathInZip)
see ZFCompress
virtual zfbool isDir(zfindex fileIndexInZip)
see ZFCompress
virtual zfbool open(const ZFInput &inputZip)
see ZFCompress
virtual zfbool valid()
see ZFCompress
virtual zfindex contentIndex(const zfstring &filePathInZip)
see ZFCompress
virtual zfbool close()
see ZFCompress
virtual void objectOnDeallocPrepare(void)
called before objectOnDealloc, safe to call virtual functions here
virtual zfindex contentCount()
see ZFCompress
virtual zfbool findFirst(ZFFileFindData &fd, const zfstring &filePathInZip)
see ZFCompress
virtual zfstring contentPath(zfindex fileIndexInZip)
see ZFCompress
virtual zfbool contentPathT(zfstring &ret, zfindex fileIndexInZip)
see ZFCompress
virtual void findClose(ZFFileFindData &fd)
see ZFCompress
virtual zfbool outputAt(const ZFOutput &outputRaw, zfindex fileIndexInZip)
see ZFCompress
virtual zfbool findNext(ZFFileFindData &fd)
see ZFCompress
data used by ZFFile when finding files
Definition ZFFile_fwd.h:53
general input callback
Definition ZFIOCallback_input.h:37
general output callback
Definition ZFIOCallback_output.h:37
path related info storage for impl, actual meaning of the info depends on impl
Definition ZFPathInfo.h:35
compress level for ZFCompress
Definition ZFCompress.h:15
static v_ZFCompressLevel::ZFEnumType EnumDefault(void)
default value for ZFCompressLevel
Definition ZFCompress.h:29
#define zftext(s)
util macro for zfstring::shared
Definition zfstring.h:694