1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-10-03 21:01:14 +00:00

ttvfs update

This commit is contained in:
fgenesis 2014-04-15 15:04:33 +02:00
commit 3cf3ac7659
13 changed files with 220 additions and 120 deletions

View file

@ -58,7 +58,7 @@ void ZipDir::load()
continue;
if(mz_zip_reader_is_file_a_directory(MZ, i))
{
getDir(fs.m_filename, true);
_createAndInsertSubtree(fs.m_filename);
continue;
}
if(getFile(fs.m_filename))

View file

@ -114,6 +114,7 @@ size_t ZipFile::read(void *dst, size_t bytes)
size_t ZipFile::write(const void *src, size_t bytes)
{
// TODO: implement actually writing to the underlying Zip file.
//printf("NYI: ZipFile::write()");
return 0;
}
@ -130,7 +131,10 @@ bool ZipFile::unpack()
delete [] _buf;
if(!_archiveHandle->openRead())
{
//assert(0 && "ZipFile unpack: Failed to openRead");
return false; // can happen if the underlying zip file was deleted
}
// In case of text data, make sure the buffer is always terminated with '\0'.
// Won't hurt for binary data, so just do it in all cases.
@ -141,6 +145,7 @@ bool ZipFile::unpack()
if(!mz_zip_reader_extract_to_mem(MZ, _fileIdx, _buf, sz, 0))
{
//assert(0 && "ZipFile unpack: Failed mz_zip_reader_extract_to_mem");
delete [] _buf;
_buf = NULL;
return false; // this should not happen