clan::ZipReader Class Reference - ClanLib SDK
Description: clan::ZipReader Class Reference

Public Member Functions | List of all members
clan::ZipReader Class Reference
clanCore I/O Data

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.

## Detailed Description

Zip file reader.

## Constructor & Destructor Documentation

## ◆ ZipReader()

clan::ZipReader::ZipReader | ( | IODevice & | input | ) |

Constructs a ZipReader.

Parameters

  input | = IODevice

## Member Function Documentation

## ◆ get_compressed_size()

int64_t clan::ZipReader::get_compressed_size | ( |  | ) | const

Returns the compressed size of the file entry.

## ◆ get_filename()

std::string clan::ZipReader::get_filename | ( |  | ) |

Returns the file name that was stored in the local file header.

## ◆ get_uncompressed_size()

int64_t clan::ZipReader::get_uncompressed_size | ( |  | ) | const

Returns the uncompressed size of the file entry.

## ◆ has_data_descriptor()

bool clan::ZipReader::has_data_descriptor | ( |  | ) | const

Returns true if the file entry is followed by a data descriptor.

## ◆ read_file_data()

int64_t clan::ZipReader::read_file_data | ( | void * | data,
|  | int64_t | size,
|  | bool | read_all = true )

Reads some file data from the zip file.

## ◆ read_local_file_header()

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.

## ◆ set_data_descriptor_data()

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.

The documentation for this class was generated from the following file:

- zip_reader.h