openshot-audio
0.1.6
|
#include <juce_core.h>
Classes | |
class | Builder |
struct | ZipEntry |
class | ZipEntryHolder |
class | ZipInputStream |
Public Member Functions | |
ZipFile (const File &file) | |
ZipFile (InputStream *inputStream, bool deleteStreamWhenDestroyed) | |
ZipFile (InputStream &inputStream) | |
ZipFile (InputSource *inputSource) | |
~ZipFile () | |
int | getNumEntries () const noexcept |
const ZipEntry * | getEntry (int index) const noexcept |
int | getIndexOfFileName (const String &fileName) const noexcept |
const ZipEntry * | getEntry (const String &fileName) const noexcept |
void | sortEntriesByFilename () |
InputStream * | createStreamForEntry (int index) |
InputStream * | createStreamForEntry (const ZipEntry &entry) |
Result | uncompressTo (const File &targetDirectory, bool shouldOverwriteFiles=true) |
Result | uncompressEntry (int index, const File &targetDirectory, bool shouldOverwriteFiles=true) |
Friends | |
class | ZipInputStream |
class | ZipEntryHolder |
Decodes a ZIP file from a stream.
This can enumerate the items in a ZIP file and can create suitable stream objects to read each one.
ZipFile::ZipFile | ( | InputStream * | inputStream, |
bool | deleteStreamWhenDestroyed | ||
) |
|
explicit |
|
explicit |
Creates a ZipFile for an input source.
The inputSource object will be owned by the zip file, which will delete it later when not needed.
ZipFile::~ZipFile | ( | ) |
Destructor.
InputStream * ZipFile::createStreamForEntry | ( | int | index | ) |
Creates a stream that can read from one of the zip file's entries.
The stream that is returned must be deleted by the caller (and zero might be returned if a stream can't be opened for some reason).
The stream must not be used after the ZipFile object that created has been deleted.
Note that if the ZipFile was created with a user-supplied InputStream object, then all the streams which are created by this method will by trying to share the same source stream, so cannot be safely used on multiple threads! (But if you create the ZipFile from a File or InputSource, then it is safe to do this).
InputStream * ZipFile::createStreamForEntry | ( | const ZipEntry & | entry | ) |
Creates a stream that can read from one of the zip file's entries.
The stream that is returned must be deleted by the caller (and zero might be returned if a stream can't be opened for some reason).
The stream must not be used after the ZipFile object that created has been deleted.
Note that if the ZipFile was created with a user-supplied InputStream object, then all the streams which are created by this method will by trying to share the same source stream, so cannot be safely used on multiple threads! (But if you create the ZipFile from a File or InputSource, then it is safe to do this).
|
noexcept |
Returns a structure that describes one of the entries in the zip file. This may return zero if the index is out of range.
|
noexcept |
Returns a structure that describes one of the entries in the zip file.
This uses a case-sensitive comparison to look for a filename in the list of entries. It might return 0 if no match is found.
|
noexcept |
Returns the index of the first entry with a given filename. This uses a case-sensitive comparison to look for a filename in the list of entries. It might return -1 if no match is found.
|
noexcept |
Returns the number of items in the zip file.
void ZipFile::sortEntriesByFilename | ( | ) |
Sorts the list of entries, based on the filename.
Result ZipFile::uncompressEntry | ( | int | index, |
const File & | targetDirectory, | ||
bool | shouldOverwriteFiles = true |
||
) |
Uncompresses one of the entries from the zip file.
This will expand the entry and write it in a target directory. The entry's path is used to determine which subfolder of the target should contain the new file.
index | the index of the entry to uncompress - this must be a valid index between 0 and (getNumEntries() - 1). |
targetDirectory | the root folder to uncompress into |
shouldOverwriteFiles | whether to overwrite existing files with similarly-named ones |
Uncompresses all of the files in the zip file.
This will expand all the entries into a target directory. The relative paths of the entries are used.
targetDirectory | the root folder to uncompress to |
shouldOverwriteFiles | whether to overwrite existing files with similarly-named ones |
|
friend |
|
friend |