2014-02-10 01:10:30 +00:00
|
|
|
/*************************************************************************/
|
|
|
|
/* file_access_zip.cpp */
|
|
|
|
/*************************************************************************/
|
|
|
|
/* This file is part of: */
|
|
|
|
/* GODOT ENGINE */
|
2017-08-27 12:16:55 +00:00
|
|
|
/* https://godotengine.org */
|
2014-02-10 01:10:30 +00:00
|
|
|
/*************************************************************************/
|
2019-01-01 11:53:14 +00:00
|
|
|
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
|
|
|
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
2014-02-10 01:10:30 +00:00
|
|
|
/* */
|
|
|
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
|
|
|
/* a copy of this software and associated documentation files (the */
|
|
|
|
/* "Software"), to deal in the Software without restriction, including */
|
|
|
|
/* without limitation the rights to use, copy, modify, merge, publish, */
|
|
|
|
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
|
|
|
/* permit persons to whom the Software is furnished to do so, subject to */
|
|
|
|
/* the following conditions: */
|
|
|
|
/* */
|
|
|
|
/* The above copyright notice and this permission notice shall be */
|
|
|
|
/* included in all copies or substantial portions of the Software. */
|
|
|
|
/* */
|
|
|
|
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
|
|
|
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
|
|
|
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
|
|
|
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
|
|
|
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
|
|
|
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
|
|
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
|
|
/*************************************************************************/
|
2018-01-04 23:50:27 +00:00
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
#ifdef MINIZIP_ENABLED
|
|
|
|
|
|
|
|
#include "file_access_zip.h"
|
|
|
|
|
2015-05-26 01:35:00 +00:00
|
|
|
#include "core/os/copymem.h"
|
2017-03-05 15:44:50 +00:00
|
|
|
#include "core/os/file_access.h"
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
ZipArchive *ZipArchive::instance = NULL;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
static void *godot_open(void *data, const char *p_fname, int mode) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
if (mode & ZLIB_FILEFUNC_MODE_WRITE) {
|
|
|
|
return NULL;
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
FileAccess *f = (FileAccess *)data;
|
2014-02-10 01:10:30 +00:00
|
|
|
f->open(p_fname, FileAccess::READ);
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
return f->is_open() ? data : NULL;
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
static uLong godot_read(void *data, void *fdata, void *buf, uLong size) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
FileAccess *f = (FileAccess *)data;
|
|
|
|
f->get_buffer((uint8_t *)buf, size);
|
2014-02-10 01:10:30 +00:00
|
|
|
return size;
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
static uLong godot_write(voidpf opaque, voidpf stream, const void *buf, uLong size) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return 0;
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
static long godot_tell(voidpf opaque, voidpf stream) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
FileAccess *f = (FileAccess *)opaque;
|
2017-09-10 13:37:49 +00:00
|
|
|
return f->get_position();
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
static long godot_seek(voidpf opaque, voidpf stream, uLong offset, int origin) {
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
FileAccess *f = (FileAccess *)opaque;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
int pos = offset;
|
|
|
|
switch (origin) {
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
case ZLIB_FILEFUNC_SEEK_CUR:
|
2017-09-10 13:37:49 +00:00
|
|
|
pos = f->get_position() + offset;
|
2017-03-05 15:44:50 +00:00
|
|
|
break;
|
|
|
|
case ZLIB_FILEFUNC_SEEK_END:
|
|
|
|
pos = f->get_len() + offset;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
f->seek(pos);
|
|
|
|
return 0;
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
static int godot_close(voidpf opaque, voidpf stream) {
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
FileAccess *f = (FileAccess *)opaque;
|
2014-02-10 01:10:30 +00:00
|
|
|
f->close();
|
|
|
|
return 0;
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
static int godot_testerror(voidpf opaque, voidpf stream) {
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
FileAccess *f = (FileAccess *)opaque;
|
|
|
|
return f->get_error() != OK ? 1 : 0;
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2015-05-26 01:35:00 +00:00
|
|
|
static voidpf godot_alloc(voidpf opaque, uInt items, uInt size) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2015-05-26 01:35:00 +00:00
|
|
|
return memalloc(items * size);
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2015-05-26 01:35:00 +00:00
|
|
|
static void godot_free(voidpf opaque, voidpf address) {
|
|
|
|
|
|
|
|
memfree(address);
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2015-05-26 01:35:00 +00:00
|
|
|
|
2018-12-08 20:07:33 +00:00
|
|
|
} // extern "C"
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
void ZipArchive::close_handle(unzFile p_file) const {
|
|
|
|
|
|
|
|
ERR_FAIL_COND(!p_file);
|
2017-03-05 15:44:50 +00:00
|
|
|
FileAccess *f = (FileAccess *)unzGetOpaque(p_file);
|
2014-02-10 01:10:30 +00:00
|
|
|
unzCloseCurrentFile(p_file);
|
|
|
|
unzClose(p_file);
|
|
|
|
memdelete(f);
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
unzFile ZipArchive::get_file_handle(String p_file) const {
|
|
|
|
|
|
|
|
ERR_FAIL_COND_V(!file_exists(p_file), NULL);
|
|
|
|
File file = files[p_file];
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
FileAccess *f = FileAccess::open(packages[file.package].filename, FileAccess::READ);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND_V(!f, NULL);
|
|
|
|
|
|
|
|
zlib_filefunc_def io;
|
2015-05-26 01:35:00 +00:00
|
|
|
zeromem(&io, sizeof(io));
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
io.opaque = f;
|
|
|
|
io.zopen_file = godot_open;
|
|
|
|
io.zread_file = godot_read;
|
|
|
|
io.zwrite_file = godot_write;
|
|
|
|
|
|
|
|
io.ztell_file = godot_tell;
|
|
|
|
io.zseek_file = godot_seek;
|
|
|
|
io.zclose_file = godot_close;
|
|
|
|
io.zerror_file = godot_testerror;
|
|
|
|
|
2015-05-26 01:35:00 +00:00
|
|
|
io.alloc_mem = godot_alloc;
|
|
|
|
io.free_mem = godot_free;
|
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
unzFile pkg = unzOpen2(packages[file.package].filename.utf8().get_data(), &io);
|
|
|
|
ERR_FAIL_COND_V(!pkg, NULL);
|
2015-05-26 01:35:00 +00:00
|
|
|
int unz_err = unzGoToFilePos(pkg, &file.file_pos);
|
2017-04-06 11:18:41 +00:00
|
|
|
if (unz_err != UNZ_OK || unzOpenCurrentFile(pkg) != UNZ_OK) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
unzClose(pkg);
|
|
|
|
ERR_FAIL_V(NULL);
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return pkg;
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-08-11 19:10:05 +00:00
|
|
|
bool ZipArchive::try_open_pack(const String &p_path) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2015-05-26 01:35:00 +00:00
|
|
|
//printf("opening zip pack %ls, %i, %i\n", p_name.c_str(), p_name.extension().nocasecmp_to("zip"), p_name.extension().nocasecmp_to("pcz"));
|
2017-08-11 19:10:05 +00:00
|
|
|
if (p_path.get_extension().nocasecmp_to("zip") != 0 && p_path.get_extension().nocasecmp_to("pcz") != 0)
|
2014-02-10 01:10:30 +00:00
|
|
|
return false;
|
|
|
|
|
|
|
|
zlib_filefunc_def io;
|
|
|
|
|
2019-02-12 20:10:08 +00:00
|
|
|
FileAccess *fa = FileAccess::open(p_path, FileAccess::READ);
|
|
|
|
if (!fa)
|
2014-02-10 01:10:30 +00:00
|
|
|
return false;
|
2019-02-12 20:10:08 +00:00
|
|
|
io.opaque = fa;
|
2014-02-10 01:10:30 +00:00
|
|
|
io.zopen_file = godot_open;
|
|
|
|
io.zread_file = godot_read;
|
|
|
|
io.zwrite_file = godot_write;
|
|
|
|
|
|
|
|
io.ztell_file = godot_tell;
|
|
|
|
io.zseek_file = godot_seek;
|
|
|
|
io.zclose_file = godot_close;
|
|
|
|
io.zerror_file = godot_testerror;
|
|
|
|
|
2017-08-11 19:10:05 +00:00
|
|
|
unzFile zfile = unzOpen2(p_path.utf8().get_data(), &io);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND_V(!zfile, false);
|
|
|
|
|
|
|
|
unz_global_info64 gi;
|
|
|
|
int err = unzGetGlobalInfo64(zfile, &gi);
|
2017-03-05 15:44:50 +00:00
|
|
|
ERR_FAIL_COND_V(err != UNZ_OK, false);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
Package pkg;
|
2017-08-11 19:10:05 +00:00
|
|
|
pkg.filename = p_path;
|
2014-02-10 01:10:30 +00:00
|
|
|
pkg.zfile = zfile;
|
|
|
|
packages.push_back(pkg);
|
2017-03-05 15:44:50 +00:00
|
|
|
int pkg_num = packages.size() - 1;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2019-09-22 16:45:08 +00:00
|
|
|
for (uint64_t i = 0; i < gi.number_entry; i++) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
char filename_inzip[256];
|
|
|
|
|
|
|
|
unz_file_info64 file_info;
|
2017-03-05 15:44:50 +00:00
|
|
|
err = unzGetCurrentFileInfo64(zfile, &file_info, filename_inzip, sizeof(filename_inzip), NULL, 0, NULL, 0);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_CONTINUE(err != UNZ_OK);
|
|
|
|
|
|
|
|
File f;
|
|
|
|
f.package = pkg_num;
|
|
|
|
unzGetFilePos(zfile, &f.file_pos);
|
|
|
|
|
|
|
|
String fname = String("res://") + filename_inzip;
|
|
|
|
files[fname] = f;
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
uint8_t md5[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
2017-08-11 19:10:05 +00:00
|
|
|
PackedData::get_singleton()->add_path(p_path, fname, 1, 0, md5, this);
|
2015-05-26 01:35:00 +00:00
|
|
|
//printf("packed data add path %ls, %ls\n", p_name.c_str(), fname.c_str());
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
if ((i + 1) < gi.number_entry) {
|
2014-02-10 01:10:30 +00:00
|
|
|
unzGoToNextFile(zfile);
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return true;
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
bool ZipArchive::file_exists(String p_name) const {
|
|
|
|
|
|
|
|
return files.has(p_name);
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
FileAccess *ZipArchive::get_file(const String &p_path, PackedData::PackedFile *p_file) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return memnew(FileAccessZip(p_path, *p_file));
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
ZipArchive *ZipArchive::get_singleton() {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
if (instance == NULL) {
|
|
|
|
instance = memnew(ZipArchive);
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return instance;
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
ZipArchive::ZipArchive() {
|
|
|
|
|
|
|
|
instance = this;
|
|
|
|
//fa_create_func = FileAccess::get_create_func();
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
ZipArchive::~ZipArchive() {
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
for (int i = 0; i < packages.size(); i++) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
FileAccess *f = (FileAccess *)unzGetOpaque(packages[i].zfile);
|
2014-02-10 01:10:30 +00:00
|
|
|
unzClose(packages[i].zfile);
|
|
|
|
memdelete(f);
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
packages.clear();
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
Error FileAccessZip::_open(const String &p_path, int p_mode_flags) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
close();
|
|
|
|
|
|
|
|
ERR_FAIL_COND_V(p_mode_flags & FileAccess::WRITE, FAILED);
|
2017-03-05 15:44:50 +00:00
|
|
|
ZipArchive *arch = ZipArchive::get_singleton();
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND_V(!arch, FAILED);
|
|
|
|
zfile = arch->get_file_handle(p_path);
|
|
|
|
ERR_FAIL_COND_V(!zfile, FAILED);
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
int err = unzGetCurrentFileInfo64(zfile, &file_info, NULL, 0, NULL, 0, NULL, 0);
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND_V(err != UNZ_OK, FAILED);
|
|
|
|
|
|
|
|
return OK;
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
void FileAccessZip::close() {
|
|
|
|
|
|
|
|
if (!zfile)
|
|
|
|
return;
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
ZipArchive *arch = ZipArchive::get_singleton();
|
2014-02-10 01:10:30 +00:00
|
|
|
ERR_FAIL_COND(!arch);
|
|
|
|
arch->close_handle(zfile);
|
|
|
|
zfile = NULL;
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
bool FileAccessZip::is_open() const {
|
|
|
|
|
|
|
|
return zfile != NULL;
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
void FileAccessZip::seek(size_t p_position) {
|
|
|
|
|
|
|
|
ERR_FAIL_COND(!zfile);
|
|
|
|
unzSeekCurrentFile(zfile, p_position);
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
void FileAccessZip::seek_end(int64_t p_position) {
|
|
|
|
|
|
|
|
ERR_FAIL_COND(!zfile);
|
|
|
|
unzSeekCurrentFile(zfile, get_len() + p_position);
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-09-10 13:37:49 +00:00
|
|
|
size_t FileAccessZip::get_position() const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
ERR_FAIL_COND_V(!zfile, 0);
|
|
|
|
return unztell(zfile);
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
size_t FileAccessZip::get_len() const {
|
|
|
|
|
|
|
|
ERR_FAIL_COND_V(!zfile, 0);
|
|
|
|
return file_info.uncompressed_size;
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
bool FileAccessZip::eof_reached() const {
|
|
|
|
|
|
|
|
ERR_FAIL_COND_V(!zfile, true);
|
|
|
|
|
|
|
|
return at_eof;
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
uint8_t FileAccessZip::get_8() const {
|
|
|
|
|
|
|
|
uint8_t ret = 0;
|
|
|
|
get_buffer(&ret, 1);
|
|
|
|
return ret;
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
int FileAccessZip::get_buffer(uint8_t *p_dst, int p_length) const {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
ERR_FAIL_COND_V(!zfile, -1);
|
|
|
|
at_eof = unzeof(zfile);
|
|
|
|
if (at_eof)
|
|
|
|
return 0;
|
|
|
|
int read = unzReadCurrentFile(zfile, p_dst, p_length);
|
|
|
|
ERR_FAIL_COND_V(read < 0, read);
|
|
|
|
if (read < p_length)
|
|
|
|
at_eof = true;
|
|
|
|
return read;
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
Error FileAccessZip::get_error() const {
|
|
|
|
|
|
|
|
if (!zfile) {
|
|
|
|
|
|
|
|
return ERR_UNCONFIGURED;
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
if (eof_reached()) {
|
|
|
|
return ERR_FILE_EOF;
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return OK;
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-09-22 05:56:02 +00:00
|
|
|
void FileAccessZip::flush() {
|
|
|
|
|
|
|
|
ERR_FAIL();
|
|
|
|
}
|
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
void FileAccessZip::store_8(uint8_t p_dest) {
|
|
|
|
|
|
|
|
ERR_FAIL();
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
bool FileAccessZip::file_exists(const String &p_name) {
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
return false;
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2018-12-08 20:07:33 +00:00
|
|
|
FileAccessZip::FileAccessZip(const String &p_path, const PackedData::PackedFile &p_file) :
|
|
|
|
zfile(NULL) {
|
2014-02-10 01:10:30 +00:00
|
|
|
_open(p_path, FileAccess::READ);
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
FileAccessZip::~FileAccessZip() {
|
|
|
|
|
|
|
|
close();
|
2018-12-08 20:07:33 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
#endif
|