Jameo Core Library
Loading...
Searching...
No Matches
Public Member Functions | List of all members
jm::ZipFile Class Reference

This class represents a ZIP file for reading ZIP data. More...

Inheritance diagram for jm::ZipFile:
jm::Object

Public Member Functions

 ZipFile (Stream *file)
 Constructor for ZipFile class.
 
 ~ZipFile () override
 Destructor.
 
void open ()
 Opens the file for reading.
 
void close ()
 Closes the file.
 
const Stringcomment () const
 Returns the comment of the ZIP file, or an empty string if no comment exists.
 
ZipEntryentry (const String &name)
 Returns the ZipEntry object if it exists, or nullptr if it does not exist.
 
LinkedListIterator entryIterator () const
 Returns an iterator over the Zip entries.
 
size_t entryCount () const
 Returns the number of Zip entries in the ZipFile.
 
Streamstream (const ZipEntry *entry)
 Returns the stream containing the uncompressed data of the entry. The caller of this method takes ownership of the stream and is responsible for cleaning it up. The stream is read-only and can only be used to read the data from a ZIP file. Writing to the stream is not supported.
 
- Public Member Functions inherited from jm::Object
 Object () noexcept
 Constructor.
 
virtual ~Object () noexcept
 Destructor.
 
void release () noexcept
 Decreases the reference counter and releases the object immediately when the reference counter becomes 0.
 
Objectretain () noexcept
 Increases the reference counter of this object by 1.
 
Objectautorelease () noexcept
 Same function as release(), but releases the object with a delay if the reference counter is 0. AutoreleasePool::drain() must be called in the to release the object.
 
int32 referenceCount () const noexcept
 Returns the value of the reference counter.
 
virtual bool equals (const Object *other) const
 Comparison of objects.
 
virtual String displayName () const
 Returns the display name of the object intended to present to a user.
 
virtual void printDiffInfo (DiffOperation operation, Object *other) const
 Output method for outputting the diff results for the diff algorithm.
 
void setHighBit (bool status) noexcept
 
bool highBit () const noexcept
 

Detailed Description

This class represents a ZIP file for reading ZIP data.

Constructor & Destructor Documentation

◆ ZipFile()

jm::ZipFile::ZipFile ( Stream file)
explicit

Constructor for ZipFile class.

Parameters
fileA pointer to the Stream object representing the ZIP file.

◆ ~ZipFile()

jm::ZipFile::~ZipFile ( )
override

Destructor.

Member Function Documentation

◆ close()

void jm::ZipFile::close ( )

Closes the file.

◆ comment()

const String & jm::ZipFile::comment ( ) const

Returns the comment of the ZIP file, or an empty string if no comment exists.

Returns
The comment of the ZIP file.

◆ entry()

ZipEntry * jm::ZipFile::entry ( const String name)

Returns the ZipEntry object if it exists, or nullptr if it does not exist.

Note
ZipFile is owner of ZipEntry. If you want to get ownership, you must call retain()
Parameters
nameThe name of the ZipEntry to retrieve.
Returns
A pointer to the ZipEntry object if it exists, or nullptr otherwise.

◆ entryCount()

size_t jm::ZipFile::entryCount ( ) const

Returns the number of Zip entries in the ZipFile.

Returns
The number of Zip entries.

◆ entryIterator()

LinkedListIterator jm::ZipFile::entryIterator ( ) const

Returns an iterator over the Zip entries.

Returns
An iterator over the Zip entries.

◆ open()

void jm::ZipFile::open ( )

Opens the file for reading.

◆ stream()

Stream * jm::ZipFile::stream ( const ZipEntry entry)

Returns the stream containing the uncompressed data of the entry. The caller of this method takes ownership of the stream and is responsible for cleaning it up. The stream is read-only and can only be used to read the data from a ZIP file. Writing to the stream is not supported.

Parameters
entryThe ZipEntry object for which the stream is requested.
Returns
A pointer to the Stream object containing the uncompressed data, or nullptr if the entry does not exist.