Zip file reader. More...
#include <zip_reader.h>
Public Member Functions | |
ZipReader (IODevice &input) | |
Constructs a ZipReader. | |
int64_t | get_compressed_size () const |
Returns the compressed size of the file entry. | |
std::string | get_filename () |
Returns the file name that was stored in the local file header. | |
int64_t | get_uncompressed_size () const |
Returns the uncompressed size of the file entry. | |
bool | has_data_descriptor () const |
Returns true if the file entry is followed by a data descriptor. | |
int64_t | read_file_data (void *data, int64_t size, bool read_all=true) |
Reads some file data from the zip file. | |
bool | read_local_file_header (bool allow_data_descriptor=false) |
Begins reading a file entry in the zip file. | |
void | set_data_descriptor_data (int64_t compressed_size, int64_t uncompressed_size, uint32_t crc32) |
Informs the zip reader what the data descriptor contains. | |
Zip file reader.
int64_t clan::ZipReader::get_compressed_size | ( | ) | const |
Returns the compressed size of the file entry.
std::string clan::ZipReader::get_filename | ( | ) |
Returns the file name that was stored in the local file header.
int64_t clan::ZipReader::get_uncompressed_size | ( | ) | const |
Returns the uncompressed size of the file entry.
bool clan::ZipReader::has_data_descriptor | ( | ) | const |
Returns true if the file entry is followed by a data descriptor.
int64_t clan::ZipReader::read_file_data | ( | void * | data, |
int64_t | size, | ||
bool | read_all = true ) |
Reads some file data from the zip file.
bool clan::ZipReader::read_local_file_header | ( | bool | allow_data_descriptor = false | ) |
Begins reading a file entry in the zip file.
If allow_data_descriptor is set to false, an exception will be thrown if the file entry sizes and crc32 values are written in a data descriptor instead of the local file header.
Returns false if there are no more file entries.
void clan::ZipReader::set_data_descriptor_data | ( | int64_t | compressed_size, |
int64_t | uncompressed_size, | ||
uint32_t | crc32 ) |
Informs the zip reader what the data descriptor contains.