OpenShot Library | OpenShotAudio  0.2.2
juce::ZipFile::Builder Class Reference

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

#include <juce_ZipFile.h>

Classes

struct  Item
 

Public Member Functions

 Builder ()
 Creates an empty builder object. More...
 
 ~Builder ()
 Destructor. More...
 
void addFile (const File &fileToAdd, int compressionLevel, const String &storedPathName=String())
 Adds a file to the list of items which will be added to the archive. More...
 
void addEntry (InputStream *streamToRead, int compressionLevel, const String &storedPathName, Time fileModificationTime)
 Adds a stream to the list of items which will be added to the archive. More...
 
bool writeToStream (OutputStream &target, double *progress) const
 Generates the zip file, writing it to the specified stream. More...
 

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().

Definition at line 193 of file juce_ZipFile.h.

Constructor & Destructor Documentation

◆ Builder()

juce::ZipFile::Builder::Builder ( )

Creates an empty builder object.

Definition at line 588 of file juce_ZipFile.cpp.

◆ ~Builder()

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

Destructor.

Definition at line 589 of file juce_ZipFile.cpp.

Member Function Documentation

◆ addFile()

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

Adds a file to the list of items which will be added to the archive.

The file isn't read immediately: 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.

Definition at line 591 of file juce_ZipFile.cpp.

References juce::File::getFileName(), juce::File::getLastModificationTime(), and juce::String::isEmpty().

◆ addEntry()

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

Adds a stream to the list of items which will 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

Definition at line 598 of file juce_ZipFile.cpp.

References juce::String::isNotEmpty().

Referenced by writeToStream().

◆ writeToStream()

bool juce::ZipFile::Builder::writeToStream ( OutputStream target,
double *  progress 
) const

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