---
Product: Aspose.Cells
Platform: cpp
Page Type: reference
Canonical URL: https://reference.aspose.org/cells/cpp/ziparchive
---

# ZipArchive

## Overview

`ZipArchive` is a class in Aspose.Cells FOSS for C++.

This class declares 5 methods for ZipArchive objects in C++ programs.
Available methods include: `AddEntry`, `FromZipBytes`, `GetEntry`, `GetEntryCount`, `ToZipBytes`.
Public members are accessible to any C++ application after installing the Aspose.Cells FOSS for C++ package.

## Methods

| Signature | Description |
|-----------|-------------|
| `FromZipBytes(zipData: std::vector<uint8_t>)` → `ZipArchive` | Parses a ZIP archive from raw bytes. Throws std::runtime_error on invalid or corrupt data. |
| `ToZipBytes()` → `std::vector<uint8_t>` | Serializes this archive to ZIP bytes using STORED (no compression). |
| `GetEntry(uri: std::string_view)` → `ZipArchiveEntry` | Gets an entry by URI. The URI is normalized (leading '/' stripped, backslashes replaced). Returns a null ZipArchiveEntry if not found. |
| `AddEntry(uri: std::string_view, data: std::vector<uint8_t>)` | Adds or replaces an entry. |
| `GetEntryCount()` → `size_t` | Gets the number of entries. |

## See Also

- [Aspose.Cells — Enterprise API Reference](https://reference.aspose.com/cells/)