archo

May 15, 2026 ยท View on GitHub

{#archivemodule}

archo

Archive and ZIP file handling.

Namespaces

NameDescription
archoZIP archive handling utilities and related helpers.

Macros

NameDescription
Archo_APIShared library exports.

{#archo_api}

Archo_API

Archo_API()

Shared library exports.

{#archo}

archo

ZIP archive handling utilities and related helpers.

Classes

NameDescription
ZipFileZIP archive reader and writer.

{#zipfile}

ZipFile

#include <icy/archo/zipfile.h>
struct ZipFile

Defined in src/archo/include/icy/archo/zipfile.h:35

ZIP archive reader and writer.

List of all members

NameKindOwner
infovariableDeclared here
fpvariableDeclared here
ZipFilefunctionDeclared here
ZipFilefunctionDeclared here
~ZipFilefunctionDeclared here
ZipFilefunctionDeclared here
ZipFilefunctionDeclared here
openfunctionDeclared here
openedfunctionDeclared here
closefunctionDeclared here
extractfunctionDeclared here
extractCurrentFilefunctionDeclared here
goToFirstFilefunctionDeclared here
goToNextFilefunctionDeclared here
openCurrentFilefunctionDeclared here
closeCurrentFilefunctionDeclared here
currentFileNamefunctionDeclared here

Public Attributes

ReturnNameDescription
std::vector< FileInfo >info
unzFilefp

{#info}

info

std::vector< FileInfo > info

Defined in src/archo/include/icy/archo/zipfile.h:104


{#fp}

fp

unzFile fp

Defined in src/archo/include/icy/archo/zipfile.h:105

Public Methods

ReturnNameDescription
ZipFileConstructs an unopened ZipFile. Call open() before use.
ZipFile explicitConstructs a ZipFile and immediately opens the archive at file.
~ZipFileCloses the archive if still open.
ZipFileDeleted constructor.
ZipFileDeleted constructor.
voidopenOpens the archive at file, closing any previously opened archive. Populates the [info](#info) vector with metadata for every entry.
boolopened const nodiscardReturns true if the archive is currently open.
voidcloseCloses the archive and releases the underlying file handle.
voidextractExtracts the archive contents to the given directory path.
boolextractCurrentFile nodiscardExtracts the current file entry to path. Validates each entry against path-traversal attacks before writing.
boolgoToFirstFile nodiscardMoves the internal cursor to the first file entry in the archive.
boolgoToNextFile nodiscardAdvances the internal cursor to the next file entry.
voidopenCurrentFileOpens the current file entry for reading.
voidcloseCurrentFileCloses the current file entry.
std::stringcurrentFileName nodiscardReturns the name (relative path) of the current file entry.

{#zipfile-1}

ZipFile

ZipFile()

Defined in src/archo/include/icy/archo/zipfile.h:38

Constructs an unopened ZipFile. Call open() before use.


{#zipfile-2}

ZipFile

explicit

explicit ZipFile(const std::filesystem::path & file)

Defined in src/archo/include/icy/archo/zipfile.h:42

Constructs a ZipFile and immediately opens the archive at file.

Parameters

  • file Path to the ZIP archive to open.

{#zipfile-3}

~ZipFile

~ZipFile()

Defined in src/archo/include/icy/archo/zipfile.h:45

Closes the archive if still open.


{#zipfile-4}

ZipFile

ZipFile(const ZipFile &) = delete

Defined in src/archo/include/icy/archo/zipfile.h:47

Deleted constructor.


{#zipfile-5}

ZipFile

ZipFile(ZipFile &&) = delete

Defined in src/archo/include/icy/archo/zipfile.h:49

Deleted constructor.


{#open-5}

open

void open(const std::filesystem::path & file)

Defined in src/archo/include/icy/archo/zipfile.h:56

Opens the archive at file, closing any previously opened archive. Populates the [info](#info) vector with metadata for every entry.

Parameters

  • file Path to the ZIP archive.

Exceptions

  • std::runtime_error if the file cannot be opened.

{#opened}

opened

const nodiscard

[[nodiscard]] bool opened() const

Defined in src/archo/include/icy/archo/zipfile.h:59

Returns true if the archive is currently open.


{#close-23}

close

void close()

Defined in src/archo/include/icy/archo/zipfile.h:62

Closes the archive and releases the underlying file handle.


{#extract}

extract

void extract(const std::filesystem::path & path)

Defined in src/archo/include/icy/archo/zipfile.h:67

Extracts the archive contents to the given directory path.

Parameters

  • path Destination directory; created automatically if necessary.

Exceptions

  • std::runtime_error if the archive is not open or a read error occurs.

{#extractcurrentfile}

extractCurrentFile

nodiscard

[[nodiscard]] bool extractCurrentFile(const std::filesystem::path & path, bool whiny = true)

Defined in src/archo/include/icy/archo/zipfile.h:74

Extracts the current file entry to path. Validates each entry against path-traversal attacks before writing.

Parameters

  • path Destination base directory.

  • whiny If true, re-throws on error; otherwise returns false.

Returns

true on success, false if whiny is false and an error occurred.


{#gotofirstfile}

goToFirstFile

nodiscard

[[nodiscard]] bool goToFirstFile()

Defined in src/archo/include/icy/archo/zipfile.h:78

Moves the internal cursor to the first file entry in the archive.

Returns

true on success, false if the archive is empty or an error occurred.


{#gotonextfile}

goToNextFile

nodiscard

[[nodiscard]] bool goToNextFile()

Defined in src/archo/include/icy/archo/zipfile.h:82

Advances the internal cursor to the next file entry.

Returns

true if another entry exists, false at end-of-list.


{#opencurrentfile}

openCurrentFile

void openCurrentFile()

Defined in src/archo/include/icy/archo/zipfile.h:86

Opens the current file entry for reading.

Exceptions

  • std::runtime_error on failure.

{#closecurrentfile}

closeCurrentFile

void closeCurrentFile()

Defined in src/archo/include/icy/archo/zipfile.h:90

Closes the current file entry.

Exceptions

  • std::runtime_error on failure.

{#currentfilename}

currentFileName

nodiscard

[[nodiscard]] std::string currentFileName()

Defined in src/archo/include/icy/archo/zipfile.h:94

Returns the name (relative path) of the current file entry.

Returns

Entry name as reported by the ZIP directory.

{#fileinfo}

FileInfo

#include <icy/archo/zipfile.h>
struct FileInfo

Defined in src/archo/include/icy/archo/zipfile.h:97

Metadata for a file entry within a ZIP archive.

List of all members

NameKindOwner
pathvariableDeclared here
compressedSizevariableDeclared here
uncompressedSizevariableDeclared here

Public Attributes

ReturnNameDescription
std::stringpathRelative path of the entry within the archive.
size_tcompressedSizeCompressed size in bytes.
size_tuncompressedSizeUncompressed size in bytes.

{#path-2}

path

std::string path

Defined in src/archo/include/icy/archo/zipfile.h:99

Relative path of the entry within the archive.


{#compressedsize}

compressedSize

size_t compressedSize

Defined in src/archo/include/icy/archo/zipfile.h:100

Compressed size in bytes.


{#uncompressedsize}

uncompressedSize

size_t uncompressedSize

Defined in src/archo/include/icy/archo/zipfile.h:101

Uncompressed size in bytes.