An entry in a zip archive on the local file system. More...
#include <ZipEntry.hpp>
Public Member Functions | |
std::unique_ptr< Uri > | append (const std::string &pathComponent) const override |
Appends the path component to the supplied URI, returning a new URI. More... | |
std::unique_ptr< ByteReadResource > | byteReadResource () const override |
Get a byte read resource for the URI. More... | |
std::unique_ptr< ByteWriteResource > | byteWriteResource () override |
Get a byte write resource for the URI. More... | |
bool | canReadFrom () const override |
Can data be read from the URI via a read resource. More... | |
bool | canWriteTo () const override |
Can data be written to the URI via a write resource. More... | |
std::unique_ptr< Uri > | clone () const override |
Clone the concrete Uri. More... | |
void | dispatch (UriDispatcher &dispatcher) const override |
Visitor pattern dispatching. More... | |
ZipEntryByteReadResource | getByteReadResource () const |
Get a byte read resource for this zip entry. More... | |
ZipEntryUtf8To32ReadResource | getUtf8To32ReadResource () const |
Get a byte read resource for this zip entry. More... | |
size_t | hashcode () const noexcept override |
Get the URI's hash code. More... | |
bool | isEntryDirectory () const |
Return true if the entry is an archive directory. More... | |
bool | isEntryFile () const |
Return true if the entry is an archive file. More... | |
bool | isIterable () const override |
Does the URI have a non-recursive iterator (examples: file and zip archive URIs). More... | |
bool | isRecursivelyIterable () const override |
Does the URI have a recursive iterator (examples: file and zip archive URIs). More... | |
bool | isRegularDirectory () const override |
Returns true if the URI points to a file directory. More... | |
bool | isRegularFile () const override |
Returns true if the URI is a regular file. More... | |
std::unique_ptr< UriIterator > | iterator () const override |
Get a (non-recursive) iterator. More... | |
std::string | name () const |
Get the name of the entry. More... | |
bool | operator== (const Uri &rhs) const override |
Compare the supplied URI to the current URI. More... | |
std::vector< char > | readEntryAsBytes () const |
Get the contents of the entry as a char vector. More... | |
std::string | readEntryAsString () const |
Get the contents of the entry as a UTF-8 string. More... | |
std::string | readEntryComment () const |
Get the comment on the entry if one exists. More... | |
std::unique_ptr< RecursiveUriIterator > | recursiveIterator () const override |
Get a recursive iterator. More... | |
std::unique_ptr< Uri > | resolve (std::string_view path) const override |
Resolve the relative or absolute path, in reference to the current URI. More... | |
size_t | size () const |
Get the uncompressed size of the entry in bytes. More... | |
std::string | toRawString () const override |
Get a string representing the raw URI. More... | |
std::string | toUriString () const override |
Get a string representing the URI, complete with scheme. More... | |
std::unique_ptr< Utf32To8WriteResource > | utf32To8WriteResource () override |
Get a UTF-32 to UTF-8 write resource for the URI. More... | |
std::unique_ptr< Utf8To32ReadResource > | utf8To32ReadResource () const override |
Get a UTF-8 to UTF-32 read resource for the URI. More... | |
Public Member Functions inherited from Uri | |
virtual | ~Uri ()=default |
Destroy the URI instance. More... | |
std::shared_ptr< Uri > | cloneToShared () const |
Clone the concrete Uri to a shared pointer. More... | |
An entry in a zip archive on the local file system.
ZipEntry instances can only be obtained by iteration over a ZipFile.
If random read access is required over the entries of a zip file , it is better to use the Unzipper class directly instead of a ZipFile URI and iterator.
|
inlineoverridevirtual |
Appends the path component to the supplied URI, returning a new URI.
If the URI type does not permit appending of path components, UnsupportedOperationException is thrown.
Implements Uri.
|
inlineoverridevirtual |
Get a byte read resource for the URI.
NotImplementedException | if the URI does not support reading |
ResourceException | if the resource could not be created |
Implements Uri.
|
inlineoverridevirtual |
Get a byte write resource for the URI.
NotImplementedException | if the URI does not support writing |
ResourceException | if the resource could not be created |
Implements Uri.
|
inlineoverridevirtual |
Can data be read from the URI via a read resource.
Implements Uri.
|
inlineoverridevirtual |
Can data be written to the URI via a write resource.
Implements Uri.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
|
inline |
Get a byte read resource for this zip entry.
ZipException | if the resource could not be created |
|
inline |
Get a byte read resource for this zip entry.
ZipException | if the resource could not be created |
|
overridevirtualnoexcept |
bool isEntryDirectory | ( | ) | const |
Return true if the entry is an archive directory.
bool isEntryFile | ( | ) | const |
Return true if the entry is an archive file.
|
inlineoverridevirtual |
Does the URI have a non-recursive iterator (examples: file and zip archive URIs).
Implements Uri.
|
inlineoverridevirtual |
Does the URI have a recursive iterator (examples: file and zip archive URIs).
Implements Uri.
|
inlineoverridevirtual |
Returns true if the URI points to a file directory.
Implements Uri.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Get a (non-recursive) iterator.
This will throw a NotImplementedException if the URI does not have an iterator.
Implements Uri.
|
inline |
Get the name of the entry.
|
overridevirtual |
Compare the supplied URI to the current URI.
Implements Uri.
|
inline |
Get the contents of the entry as a char vector.
name | the name of the entry |
|
inline |
Get the contents of the entry as a UTF-8 string.
|
inline |
Get the comment on the entry if one exists.
ZipException | if the entry comment could not be obtained |
|
inlineoverridevirtual |
Get a recursive iterator.
This will throw a NotImplementedException if the URI does not have a recursive iterator.
Implements Uri.
|
inlineoverridevirtual |
Resolve the relative or absolute path, in reference to the current URI.
If the supplied path contains a scheme prefix, the URI fromString function will be called to create a new unrelated URI instance.
This method will determine the base path to use by applying the following rules.
path | a relative or absolute path, or a full URI |
Implements Uri.
size_t size | ( | ) | const |
Get the uncompressed size of the entry in bytes.
|
inlineoverridevirtual |
Get a string representing the raw URI.
This may or may not be the same as the string returned by toUriString().
Implements Uri.
|
overridevirtual |
Get a string representing the URI, complete with scheme.
Implements Uri.
|
inlineoverridevirtual |
Get a UTF-32 to UTF-8 write resource for the URI.
NotImplementedException | if the URI does not support writing |
ResourceException | if the resource could not be created |
Implements Uri.
|
inlineoverridevirtual |
Get a UTF-8 to UTF-32 read resource for the URI.
NotImplementedException | if the URI does not support reading |
ResourceException | if the resource could not be created |
Implements Uri.