Orcus
|
Public Member Functions | |
zip_archive (const zip_archive &)=delete | |
zip_archive & | operator= (const zip_archive)=delete |
zip_archive (zip_archive_stream *stream) | |
void | load () |
zip_file_entry_header | get_file_entry_header (std::size_t index) const |
zip_file_entry_header | get_file_entry_header (std::string_view name) const |
std::string_view | get_file_entry_name (std::size_t index) const |
size_t | get_file_entry_count () const |
std::vector< unsigned char > | read_file_entry (std::string_view entry_name) const |
size_t orcus::zip_archive::get_file_entry_count | ( | ) | const |
Return the number of file entries stored in this zip archive. Note that a file entry may be a directory, so the number of files stored in the zip archive may not equal the number of file entries.
zip_file_entry_header orcus::zip_archive::get_file_entry_header | ( | std::size_t | index | ) | const |
Retrieve the header information for a file entry specified by index.
index | file entry index. |
zip_file_entry_header orcus::zip_archive::get_file_entry_header | ( | std::string_view | name | ) | const |
Retrieve the header information for a file entry specified by name.
name | file entry name. |
std::string_view orcus::zip_archive::get_file_entry_name | ( | std::size_t | index | ) | const |
Get file entry name from its index.
index | file entry index |
void orcus::zip_archive::load | ( | ) |
Loading involves the parsing of the central directory of a zip archive (located toward the end of the stream) and building of file entry data which are stored in the central directory.
std::vector<unsigned char> orcus::zip_archive::read_file_entry | ( | std::string_view | entry_name | ) | const |
Retrieve data stream of specified file entry. The retrieved data stream gets uncompressed if the original stream is compressed.
entry_name | file entry name. |
zip_error | thrown when any problem is encountered during data stream retrieval. |