123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- #ifndef ZIP_PACKER_H
- #define ZIP_PACKER_H
- #include "core/io/file_access.h"
- #include "core/object/ref_counted.h"
- #include "thirdparty/minizip/zip.h"
- class ZIPPacker : public RefCounted {
- GDCLASS(ZIPPacker, RefCounted);
- Ref<FileAccess> fa;
- zipFile zf = nullptr;
- protected:
- static void _bind_methods();
- public:
- enum ZipAppend {
- APPEND_CREATE = 0,
- APPEND_CREATEAFTER = 1,
- APPEND_ADDINZIP = 2,
- };
- Error open(const String &p_path, ZipAppend p_append);
- Error close();
- Error start_file(const String &p_path);
- Error write_file(const Vector<uint8_t> &p_data);
- Error close_file();
- ZIPPacker();
- ~ZIPPacker();
- };
- VARIANT_ENUM_CAST(ZIPPacker::ZipAppend)
- #endif
|