JUCE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Member Functions | List of all members
ZipFile::Builder Class Reference

Used to create a new zip file. More...

Public Member Functions

 Builder ()
 
 ~Builder ()
 
void addFile (const File &fileToAdd, int compressionLevel, const String &storedPathName=String::empty)
 Adds a file while should be added to the archive.
 
void addEntry (InputStream *streamToRead, int compressionLevel, const String &storedPathName, Time fileModificationTime)
 Adds a file while should be added to the archive.
 
bool writeToStream (OutputStream &target, double *progress) const
 Generates the zip file, writing it to the specified stream.
 

Detailed Description

Used to create a new zip file.

Create a ZipFile::Builder object, and call its addFile() method to add some files, then you can write it to a stream with write().

Currently this just stores the files with no compression.. That will be added soon!

Constructor & Destructor Documentation

ZipFile::Builder::Builder ( )
ZipFile::Builder::~Builder ( )

Member Function Documentation

void ZipFile::Builder::addFile ( const File fileToAdd,
int  compressionLevel,
const String storedPathName = String::empty 
)

Adds a file while should be added to the archive.

The file isn't read immediately, all the files will be read later when the writeToStream() method is called.

The compressionLevel can be between 0 (no compression), and 9 (maximum compression). If the storedPathName parameter is specified, you can customise the partial pathname that will be stored for this file.

void ZipFile::Builder::addEntry ( InputStream streamToRead,
int  compressionLevel,
const String storedPathName,
Time  fileModificationTime 
)

Adds a file while should be added to the archive.

Parameters
streamToReadthis stream isn't read immediately - a pointer to the stream is stored, then used later when the writeToStream() method is called, and deleted by the Builder object when no longer needed, so be very careful about its lifetime and the lifetime of any objects on which it depends! This must not be null.
compressionLevelthis can be between 0 (no compression), and 9 (maximum compression).
storedPathNamethe partial pathname that will be stored for this file
fileModificationTimethe timestamp that will be stored as the last modification time of this entry
bool ZipFile::Builder::writeToStream ( OutputStream target,
double *  progress 
) const

Generates the zip file, writing it to the specified stream.

If the progress parameter is non-null, it will be updated with an approximate progress status between 0 and 1.0


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