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

This class functions as a wrapper around any class that provides the necessary functionality for a zip archive. More...

#include <IZipArchive.hpp>

Public Member Functions

 IZipArchive ()
 Default constructor.
 
template<typename T >
 IZipArchive (const T &zipArchive)
 Constructor, taking the target object as an argument.
 
 IZipArchive (const IZipArchive &other)
 Copy constructor.
 
 IZipArchive (IZipArchive &&other) noexcept=default
 Move constructor.
 
 ~IZipArchive ()=default
 Destructor.
 
template<typename T >
IZipArchiveoperator= (const T &zipArchive)
 
IZipArchiveoperator= (const IZipArchive &other)
 
IZipArchiveoperator= (IZipArchive &&other) noexcept=default
 
 operator bool () const
 
bool isValid () const
 
bool isOpen () const
 
void open (const std::string &fileName)
 
void close () const
 
void save (const std::string &path)
 
void addEntry (const std::string &name, const std::string &data)
 
void addEntryFromFile (std::string_view name, std::string_view filePath)
 
void deleteEntry (const std::string &entryName)
 
std::string getEntry (const std::string &name) const
 
void * openEntryStream (std::string_view name) const
 
int64_t readEntryStream (void *stream, char *buffer, uint64_t size) const
 
void closeEntryStream (void *stream) const
 
bool hasEntry (const std::string &entryName) const
 
std::vector< std::string > entryNames () const
 
void setCompressionLevel (int level)
 
int compressionLevel () const
 

Detailed Description

This class functions as a wrapper around any class that provides the necessary functionality for a zip archive.

This class works by applying 'type erasure'. This enables the use of objects of any class, the only requirement being that it provides the right interface. No inheritance from a base class is needed.

Constructor & Destructor Documentation

◆ IZipArchive() [1/4]

OpenXLSX::IZipArchive::IZipArchive ( )
inline

Default constructor.

◆ IZipArchive() [2/4]

template<typename T >
OpenXLSX::IZipArchive::IZipArchive ( const T &  zipArchive)
inline

Constructor, taking the target object as an argument.

Template Parameters
TThe type of the target object (will be auto deducted)
Parameters
xThe target object
Note
This method is deliberately not marked 'explicit', because as a templated constructor, it should be able to take any type as an argument. However, only objects that satisfy the required interface can be used.

◆ IZipArchive() [3/4]

OpenXLSX::IZipArchive::IZipArchive ( const IZipArchive other)
inline

Copy constructor.

Parameters
other

◆ IZipArchive() [4/4]

OpenXLSX::IZipArchive::IZipArchive ( IZipArchive &&  other)
defaultnoexcept

Move constructor.

Parameters
other

◆ ~IZipArchive()

OpenXLSX::IZipArchive::~IZipArchive ( )
default

Destructor.

Member Function Documentation

◆ addEntry()

void OpenXLSX::IZipArchive::addEntry ( const std::string &  name,
const std::string &  data 
)
inline

◆ addEntryFromFile()

void OpenXLSX::IZipArchive::addEntryFromFile ( std::string_view  name,
std::string_view  filePath 
)
inline

◆ close()

void OpenXLSX::IZipArchive::close ( ) const
inline

◆ closeEntryStream()

void OpenXLSX::IZipArchive::closeEntryStream ( void *  stream) const
inline

◆ compressionLevel()

int OpenXLSX::IZipArchive::compressionLevel ( ) const
inline

◆ deleteEntry()

void OpenXLSX::IZipArchive::deleteEntry ( const std::string &  entryName)
inline

◆ entryNames()

std::vector< std::string > OpenXLSX::IZipArchive::entryNames ( ) const
inline

◆ getEntry()

std::string OpenXLSX::IZipArchive::getEntry ( const std::string &  name) const
inline

◆ hasEntry()

bool OpenXLSX::IZipArchive::hasEntry ( const std::string &  entryName) const
inline

◆ isOpen()

bool OpenXLSX::IZipArchive::isOpen ( ) const
inline

◆ isValid()

bool OpenXLSX::IZipArchive::isValid ( ) const
inline

◆ open()

void OpenXLSX::IZipArchive::open ( const std::string &  fileName)
inline

◆ openEntryStream()

void * OpenXLSX::IZipArchive::openEntryStream ( std::string_view  name) const
inline

◆ operator bool()

OpenXLSX::IZipArchive::operator bool ( ) const
inlineexplicit
Returns

◆ operator=() [1/3]

IZipArchive & OpenXLSX::IZipArchive::operator= ( const IZipArchive other)
inline
Parameters
other
Returns

◆ operator=() [2/3]

template<typename T >
IZipArchive & OpenXLSX::IZipArchive::operator= ( const T &  zipArchive)
inline
Template Parameters
T
Parameters
x
Returns

◆ operator=() [3/3]

IZipArchive & OpenXLSX::IZipArchive::operator= ( IZipArchive &&  other)
inlinedefaultnoexcept
Parameters
other
Returns

◆ readEntryStream()

int64_t OpenXLSX::IZipArchive::readEntryStream ( void *  stream,
char *  buffer,
uint64_t  size 
) const
inline

◆ save()

void OpenXLSX::IZipArchive::save ( const std::string &  path)
inline

◆ setCompressionLevel()

void OpenXLSX::IZipArchive::setCompressionLevel ( int  level)
inline

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