Aria  2.8.0
ArZippable Class Referenceabstract

Interface to access and modify a specified zip file. More...

#include <ArZippable.h>

Public Types

enum  { CASE_INSENSITIVE = 2 }
 
enum  ModeType { ZIP_MODE, UNZIP_MODE }
 Modes in which the zip file may be opened.
 

Public Member Functions

virtual bool addAll (const char *sourceDir, bool isIncludeSubDirs, bool isOverwrite, const char *password=NULL, int flush=0)=0
 Adds all of the files in the specified directory to the zip file. More...
 
virtual bool addFile (const char *memberName, bool isOverwrite, const char *sourceFileName, const char *password, int flush=0)=0
 Adds the specified file to the zip file. More...
 
 ArZippable ()
 Constructor.
 
virtual void close ()=0
 Closes the zip file.
 
virtual bool contains (const char *memberName)=0
 Determines whether the zip file contains the specified member name. More...
 
virtual bool exists () const =0
 Determines whether the zip file exists (according to the file path name) More...
 
virtual bool extractAll (const char *destDir, bool isOverwrite, const char *password=NULL)=0
 Extracts all of the files from the zip file. More...
 
virtual bool extractFile (const char *memberName, const char *destDir, bool isOverwrite, const char *destFileName=NULL, const char *password=NULL)=0
 Extracts the specified file from the zip file. More...
 
virtual const char * getFilePathName () const =0
 Returns the complete file path name of the zip file.
 
virtual bool open (ModeType mode)=0
 Opens the zip file in the specified mode. More...
 
virtual ~ArZippable ()
 Destructor.
 

Detailed Description

Interface to access and modify a specified zip file.

ArZippable is an abstract base class that defines the methods to add and extract files from a zip file.

An ArZippable is expected to be used in a rather "atomic" manner. It can be opened in one of two modes (ZIP_MODE or UNZIP_MODE), and the available operations are subsequently restricted based on the mode:

After the files are added to or extracted from the zip file, it should be close()'ed.

Member Function Documentation

◆ addAll()

virtual bool ArZippable::addAll ( const char *  sourceDir,
bool  isIncludeSubDirs,
bool  isOverwrite,
const char *  password = NULL,
int  flush = 0 
)
pure virtual

Adds all of the files in the specified directory to the zip file.

The zip file must have been opened in ZIP_MODE.

Parameters
sourceDirthe char * name of the directory from which the files are to be added
isIncludeSubDirsa bool set to true if all files in all subdirectories should also be added to the zip file; false otherwise
isOverwritea bool set to true if a file to be added should overwrite an existing zip file member of the same name; false if it should be skipped
passwordan optional char * password to be applied to the addition
flushan optional int indication of how the zip file should be flushed when writing (for error recovery); implementation dependent
Returns
bool set to true if all files were successfully added (or correctly skipped); false if an error occurred

◆ addFile()

virtual bool ArZippable::addFile ( const char *  memberName,
bool  isOverwrite,
const char *  sourceFileName,
const char *  password,
int  flush = 0 
)
pure virtual

Adds the specified file to the zip file.

The zip file must have been opened in ZIP_MODE.

Parameters
memberNamethe char * name of the member to be added in the zip file
isOverwritea bool set to true if a file to be added should overwrite an existing zip file member of the same name; false if it should be skipped
sourceFileNamethe char * name of the file to be added
passwordan optional char * password to be applied to the addition
flushan optional int indication of how the zip file should be flushed when writing (for error recovery); implementation dependent
Returns
bool set to true if all files were successfully added (or correctly skipped); false if an error occurred

◆ contains()

virtual bool ArZippable::contains ( const char *  memberName)
pure virtual

Determines whether the zip file contains the specified member name.

Parameters
memberNamethe char * name of the member to be found
Returns
bool true if the zip file contains the specified member; false otherwise

◆ exists()

virtual bool ArZippable::exists ( ) const
pure virtual

Determines whether the zip file exists (according to the file path name)

Returns
bool true if the file exists and can be read; false, otherwise

◆ extractAll()

virtual bool ArZippable::extractAll ( const char *  destDir,
bool  isOverwrite,
const char *  password = NULL 
)
pure virtual

Extracts all of the files from the zip file.

The zip file must have been opened in UNZIP_MODE.

Parameters
destDirthe char * name of the directory into which the extracted files are to be placed
isOverwritea bool set to true if an extracted file should overwrite an existing file of the same name in the destination directory; false if it should be skipped
passwordan optional char * password to be applied to the extraction
Returns
bool set to true if all files were successfully extracted (or correctly skipped); false if an error occurred

◆ extractFile()

virtual bool ArZippable::extractFile ( const char *  memberName,
const char *  destDir,
bool  isOverwrite,
const char *  destFileName = NULL,
const char *  password = NULL 
)
pure virtual

Extracts the specified file from the zip file.

The zip file must have been opened in UNZIP_MODE.

Parameters
memberNamethe char * name of the file that should be extracted
destDirthe char * name of the directory into which the extracted files are to be placed
isOverwritea bool set to true if an extracted file should overwrite an existing file of the same name in the destination directory; false if it should be skipped
destFileNamean optional char * name of the destination file to be written; if NULL, then memberName is used
passwordan optional char * password to be applied to the extraction
Returns
bool set to true if the file was successfully extracted (or correctly skipped); false if an error occurred

◆ open()

virtual bool ArZippable::open ( ModeType  mode)
pure virtual

Opens the zip file in the specified mode.

Parameters
modethe ModeType in which the file should be opened
Returns
bool true if the zip file was successfully opened in the specified mode; false, otherwise.

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