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

Detailed Description

Example code that shows you how to write a ZipReader interface for the ZipIo class.

This example code shows you how to write a ZipReader driver object. The ZipIo class uses the ZipReader driver object when reading Zip-data from a Zip-File. See class ZipIo for more information.

This example code uses the file system for reading the Zip-File. The constructor opens the Zip-File and method "diskRead", see code, uses the Posix function fseek for setting the file pointer to the requested offset position and function fread for reading the actual data.

#include <FileZipReader.h>

Inheritance diagram for FileZipReader:

Public Member Functions

 FileZipReader (const char *pathName)
 The ZipReader constructor opens the Zip-File for reading. More...
 
 ~FileZipReader ()
 The destructor closes the file connection. More...
 
- 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

◆ FileZipReader()

FileZipReader::FileZipReader ( const char *  pathName)

The ZipReader constructor opens the Zip-File for reading.

You must call CspReader::isValid, which informs you if the constructor successfully opened the Zip-File for reading.

Parameters
pathNameis the path and name to the Zip-File.

◆ ~FileZipReader()

FileZipReader::~FileZipReader ( )

The destructor closes the file connection.