Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
IoIntfZipReader Struct Reference

Detailed Description

The IoIntfZipReader, which implements the abstract ZipReader interface, makes it possible for a ZipIo to open a ZIP file via another IoInterface.

#include <IoIntfZipReader.h>

Inheritance diagram for IoIntfZipReader:

Public Member Functions

 IoIntfZipReader ()
 Uninitialized storage; call IoIntfZipReader_constructor before use or destruction. More...
 
 IoIntfZipReader (IoIntf *io, const char *pathName)
 The IoIntfZipReader constructor opens the ZIP file for reading. More...
 
 ~IoIntfZipReader ()
 Close any open resource, ignoring the close status. More...
 
int close ()
 Close and consume the underlying resource, even if closing fails. More...
 
int getECode ()
 
- Public Member Functions inherited from ZipReader
 ZipReader ()
 Uninitialized storage; call ZipReader_constructor before use. More...
 
 ZipReader (CspReader_Read r, U32 zipFileSize)
 Initialize a reader interface; no ZIP data is read yet. More...
 
- Public Member Functions inherited from CspReader
bool isValid ()
 
int read (void *data, U32 offset, U32 size, bool blockStart)
 Invoke the installed CspReader_Read callback synchronously. More...
 
void setIsValid ()
 Mark the implementation initialized after opening/checking its data. More...
 

Constructor & Destructor Documentation

◆ IoIntfZipReader() [1/2]

IoIntfZipReader::IoIntfZipReader ( )

Uninitialized storage; call IoIntfZipReader_constructor before use or destruction.

◆ IoIntfZipReader() [2/2]

IoIntfZipReader::IoIntfZipReader ( IoIntf *  io,
const char *  pathName 
)

The IoIntfZipReader constructor opens the ZIP file for reading.

Parameters
ioBorrowed I/O interface. Keep it alive until the reader closes. The interface must support seeking, or provide the seekAndRead property.
pathNameRequired NUL-terminated ZIP file path relative to io; used during construction only. File size must fit U32 (no ZIP64). Check getECode and inherited CspReader::isValid before use.

◆ ~IoIntfZipReader()

IoIntfZipReader::~IoIntfZipReader ( )

Close any open resource, ignoring the close status.

Destroy dependent ZipIo objects and stop reads before destruction.

Member Function Documentation

◆ close()

int IoIntfZipReader::close ( )

Close and consume the underlying resource, even if closing fails.

Do not use a dependent ZipIo after this call.

Returns
Underlying close status (zero success, negative failure), or -1 if no resource is open. Does not update getECode. The inherited isValid flag is not a current open/closed test.

◆ getECode()

int IoIntfZipReader::getECode ( )
Returns
Last construction or read status (zero success, otherwise an I/O error). Short reads become IOINTF_IOERROR. Close errors and reads attempted after close are not recorded here.