QuaZip is a class representing ZIP archive, QuaZipFile represents a file inside archive and subclasses QIODevice as well.
"ZIP/UNZIP API" means the original API of the Gilles Vollant's ZIP/UNZIP package. I did not alter it in any way to make it easier to port to the future ZIP/UNZIP versions.
"ZIP", "ZIP archive" or "ZIP file" means any ZIP archive. Typically this is a plain file with ".zip" (or ".ZIP") file name suffix.
"A file inside archive", "a file inside ZIP" or something like that means file either being read or written from/to some ZIP archive.
Therefore, error checking is two-level (QuaZIP's level and ZIP/UNZIP API level), which sometimes can be confusing, so here are some advices on how the error checking should be properly done:
const
and do not access ZIP archive in any way. Some, on the other hand, do access ZIP archive, but do not reset or set error code. For example, QuaZipFile::pos() function. Such functions are explicitly marked in the documentation.false
. If such a function returns error value, call getZipError() to get more information about error. See "zip.h" and "unzip.h" of the ZIP/UNZIP package for error codes.false
), but getZipError() returns UNZ_OK, it means that you did something obviously wrong. For example, tried to write in the archive open for reading or not open at all. You better just do not do that! Most functions also issue a warning using qWarning() function in such cases. See documentation for a specific function for details on when it should not be called.I know that this is somewhat messy, but I could not find a better way to do all the error handling.