wavelength 1.0.0
Loading...
Searching...
No Matches
Tools::BuildImage::ZipArchive Class Reference

Reader of the stored and deflated members of a zip archive in memory. More...

#include <ziparchive.h>

Public Member Functions

std::vector< std::string > names () const
 List the member names in central directory order.
std::expected< std::vector< std::uint8_t >, Error > extract (const std::string &name) const
 Extract one member.
std::expected< Seconds, Error > modified (const std::string &name) const
 Read the modification time of one member.

Static Public Member Functions

static std::expected< ZipArchive, Error > open (std::vector< std::uint8_t > data)
 Read the central directory of an archive.

Detailed Description

Reader of the stored and deflated members of a zip archive in memory.

Member Function Documentation

◆ open()

std::expected< ZipArchive, Error > Tools::BuildImage::ZipArchive::open ( std::vector< std::uint8_t > data)
static

Read the central directory of an archive.

Parameters
dataArchive bytes. The archive takes them over.
Returns
The archive, or an error when the bytes are not a zip archive.

◆ names()

std::vector< std::string > Tools::BuildImage::ZipArchive::names ( ) const
nodiscard

List the member names in central directory order.

Returns
Member names, with their directory parts.

◆ extract()

std::expected< std::vector< std::uint8_t >, Error > Tools::BuildImage::ZipArchive::extract ( const std::string & name) const
nodiscard

Extract one member.

Parameters
nameMember name, as names() lists it.
Returns
Member contents, or an error when the member is missing or damaged.

◆ modified()

std::expected< Seconds, Error > Tools::BuildImage::ZipArchive::modified ( const std::string & name) const
nodiscard

Read the modification time of one member.

Parameters
nameMember name, as names() lists it.
Returns
The time from the central directory, read as UTC, or an error when the member is missing.

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