OpenXLSX 1.9.1
Loading...
Searching...
No Matches
OpenXLSX::XLZipArchive Class Reference

#include <XLZipArchive.hpp>

Data Structures

struct  LibZipApp
 

Public Member Functions

 XLZipArchive ()
 
 XLZipArchive (const XLZipArchive &other)=default
 
 XLZipArchive (XLZipArchive &&other) noexcept=default
 
 ~XLZipArchive ()
 
XLZipArchiveoperator= (const XLZipArchive &other)=default
 
XLZipArchiveoperator= (XLZipArchive &&other) noexcept=default
 
 operator bool () const
 
bool isValid () const
 
bool isOpen () const
 
void open (std::string_view fileName)
 
void close ()
 
void save (std::string_view path="")
 
void addEntry (std::string_view name, std::string_view data)
 
void addEntryFromFile (std::string_view name, std::string_view filePath)
 Add a file to the ZIP archive directly from the file system (useful for streaming large files).
 
void deleteEntry (std::string_view entryName)
 
std::string getEntry (std::string_view name) const
 
void * openEntryStream (std::string_view name) const
 Opens a stream for reading a specific entry.
 
int64_t readEntryStream (void *stream, char *buffer, uint64_t size) const
 Reads data from an opened stream.
 
void closeEntryStream (void *stream) const
 Closes an opened stream.
 
bool hasEntry (std::string_view entryName) const
 
std::vector< std::string > entryNames () const
 Get a list of all entry names in the archive.
 
void setCompressionLevel (int level)
 Set the compression level for packing the archive.
 
int compressionLevel () const
 Get the current compression level.
 

Constructor & Destructor Documentation

◆ XLZipArchive() [1/3]

XLZipArchive::XLZipArchive ( )

◆ XLZipArchive() [2/3]

OpenXLSX::XLZipArchive::XLZipArchive ( const XLZipArchive other)
default
Parameters
other

◆ XLZipArchive() [3/3]

OpenXLSX::XLZipArchive::XLZipArchive ( XLZipArchive &&  other)
defaultnoexcept
Parameters
other

◆ ~XLZipArchive()

XLZipArchive::~XLZipArchive ( )
default

Member Function Documentation

◆ addEntry()

void XLZipArchive::addEntry ( std::string_view  name,
std::string_view  data 
)
Parameters
name
data

◆ addEntryFromFile()

void XLZipArchive::addEntryFromFile ( std::string_view  name,
std::string_view  filePath 
)

Add a file to the ZIP archive directly from the file system (useful for streaming large files).

Parameters
nameThe name of the entry within the ZIP archive.
filePathThe path to the file on disk.

◆ close()

void XLZipArchive::close ( )

◆ closeEntryStream()

void XLZipArchive::closeEntryStream ( void *  stream) const

Closes an opened stream.

Parameters
streamThe opaque stream pointer.

◆ compressionLevel()

int XLZipArchive::compressionLevel ( ) const

Get the current compression level.

◆ deleteEntry()

void XLZipArchive::deleteEntry ( std::string_view  entryName)
Parameters
entryName

◆ entryNames()

std::vector< std::string > XLZipArchive::entryNames ( ) const

Get a list of all entry names in the archive.

Returns
A vector of strings containing the names of all entries.

◆ getEntry()

std::string XLZipArchive::getEntry ( std::string_view  name) const
Parameters
name
Returns

◆ hasEntry()

bool XLZipArchive::hasEntry ( std::string_view  entryName) const
Parameters
entryName
Returns

◆ isOpen()

bool XLZipArchive::isOpen ( ) const
Returns

◆ isValid()

bool XLZipArchive::isValid ( ) const

◆ open()

void XLZipArchive::open ( std::string_view  fileName)
Parameters
fileName

◆ openEntryStream()

void * XLZipArchive::openEntryStream ( std::string_view  name) const

Opens a stream for reading a specific entry.

Parameters
nameThe name of the entry to open.
Returns
An opaque pointer to the stream.

◆ operator bool()

XLZipArchive::operator bool ( ) const
explicit
Returns

◆ operator=() [1/2]

XLZipArchive & OpenXLSX::XLZipArchive::operator= ( const XLZipArchive other)
default
Parameters
other
Returns

◆ operator=() [2/2]

XLZipArchive & OpenXLSX::XLZipArchive::operator= ( XLZipArchive &&  other)
defaultnoexcept
Parameters
other
Returns

◆ readEntryStream()

int64_t XLZipArchive::readEntryStream ( void *  stream,
char *  buffer,
uint64_t  size 
) const

Reads data from an opened stream.

Parameters
streamThe opaque stream pointer.
bufferThe buffer to read into.
sizeThe maximum number of bytes to read.
Returns
The number of bytes read, or -1 on error.

◆ save()

void XLZipArchive::save ( std::string_view  path = "")
Parameters
path

◆ setCompressionLevel()

void XLZipArchive::setCompressionLevel ( int  level)

Set the compression level for packing the archive.

Parameters
levelThe compression level to use (e.g., 1 for fastest, 9 for best). Default is 1.

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