zipios man page

zipios — The zipios namespace includes the Zipios++ library definitions.

Synopsis

Namespaces

anonymous_namespace{collectioncollection.cpp}

anonymous_namespace{filecollection.cpp}

anonymous_namespace{filepath.cpp}

anonymous_namespace{zipcentraldirectoryentry.cpp}

anonymous_namespace{zipendofcentraldirectory.cpp}
Private definitions of the ZipEndOfCentralDirectory class.
anonymous_namespace{ziplocalentry.cpp}
Various definitions for local blocks.
anonymous_namespace{zipoutputstreambuf.cpp}

Classes

class BackBuffer
To read a file by chunk from the end.
class CollectionCollection
A collection of collections.
class DeflateOutputStreambuf
A class to handle stream deflate on the fly.
class DirectoryCollection
A collection generated from reading a directory.
class DirectoryEntry
A file entry that does not use compression.
class Exception
Base exception of the zipios environement.
class FileCollection
Base class for various file collections.
class FileCollectionException
FileCollectionException is used to signal a FileCollection problem.
class FileEntry
A FileEntry represents an entry in a FileCollection.
class FilePath
Handle a file path and name and its statistics.
class FilterInputStreambuf
A base class to develop input stream filters.
class FilterOutputStreambuf
A base class to develop output stream filters.
class GZIPOutputStream
A stream implementation that outputs data to a ZIP file.
class GZIPOutputStreambuf
Save the output stream buffer.
class InflateInputStreambuf
A stream buffer to inflate data previous compressed with zlib.
class InvalidException
An InvalidException is used when invalid data is provided.
class InvalidStateException
Exception used when it is not possible to move forward.
class IOException
An IOException is used to signal an I/O error.
class VirtualSeeker
A virtual class used to see in a file embedded in another.
class ZipCentralDirectoryEntry
A specialization of ZipLocalEntry for.
class ZipEndOfCentralDirectory
Marker at the end of a Zip archive file.
class ZipFile
The ZipFile class represents a collection of files.
class ZipInputStream
The ZipInputStream to read data from a Zip archive.
class ZipInputStreambuf
An input stream buffer for Zip data.
class ZipLocalEntry
An implementation of the FileEntry for Zip archives.
class ZipOutputStream
A ZipOutputStream to allow for data to be compressed zlib.
class ZipOutputStreambuf
Handle the output buffer of a zip archive.

Typedefs

typedef std::vector< unsigned char > buffer_t
A buffer of characters.
typedef std::streamoff offset_t

typedef std::ostringstream OutputStringStream
An output stream using strings.

Enumerations

enum StorageMethod : uint8_t { StorageMethod::STORED = 0, StorageMethod::SHRUNK = 1, StorageMethod::REDUCED1 = 2, StorageMethod::REDUCED2 = 3, StorageMethod::REDUCED3 = 4, StorageMethod::REDUCED4 = 5, StorageMethod::IMPLODED = 6, StorageMethod::TOKENIZED = 7, StorageMethod::DEFLATED = 8, StorageMethod::DEFLATED64 = 9, StorageMethod::OLD_TERSE = 10, StorageMethod::RESERVED11 = 11, StorageMethod::BZIP2 = 12, StorageMethod::REVERVED13 = 13, StorageMethod::LZMA = 14, StorageMethod::RESERVED15 = 15, StorageMethod::RESERVED16 = 16, StorageMethod::RESERVED17 = 17, StorageMethod::NEW_TERSE = 18, StorageMethod::LZ77 = 19, StorageMethod::WAVPACK = 97, StorageMethod::PPMD_I_1 = 98 } The types used with FileEntry::setMethod and FileEntry::getMethod. "

Functions

size_t getBufferSize ()

char const * getVersion ()

std::ostream & operator<< (std::ostream &os, FilePath const &path)
Print out a FilePath.
std::ostream & operator<< (std::ostream &os, FileCollection const &collection)
Write a FileCollection to the output stream.
std::ostream & operator<< (std::ostream &os, FileEntry const &entry)
Output an entry as a string to a stream.
bool operator== (char const *lhs, FilePath const &rhs)
Check whether two FilePath represent the same file.
bool operator== (std::string const &lhs, FilePath const &rhs)
Check whether two FilePath represent the same file.
void zipRead (std::istream &is, uint32_t &value)

void zipRead (std::istream &is, uint16_t &value)

void zipRead (std::istream &is, uint8_t &value)

void zipRead (std::istream &is, buffer_t &buffer, ssize_t const count)

void zipRead (std::istream &is, std::string &str, ssize_t const count)

void zipRead (buffer_t const &is, size_t &pos, uint32_t &value)

void zipRead (buffer_t const &is, size_t &pos, uint16_t &value)

void zipRead (buffer_t const &is, size_t &pos, uint8_t &value)

void zipRead (buffer_t const &is, size_t &pos, buffer_t &buffer, ssize_t const count)

void zipRead (buffer_t const &is, size_t &pos, std::string &str, ssize_t const count)

void zipWrite (std::ostream &os, uint32_t const &value)

void zipWrite (std::ostream &os, uint16_t const &value)

void zipWrite (std::ostream &os, uint8_t const &value)

void zipWrite (std::ostream &os, buffer_t const &buffer)

void zipWrite (std::ostream &os, std::string const &str)

Variables

char const g_separator = '/'
The character used as the filename separator.

Detailed Description

This namespace is used to clearly separate all the Zipios++ definitions. Note that a very few definitions are found outside of the namespace. Some of those are hidden in the source of the library, a very few appear in the zipios-config.hpp file as they are used to support Zipios++ on any platform.

Note that to ensure secure development, we do not make use of the C++ 'using ...' keyword. That way we can guarantee what's what.

Typedef Documentation

std::vector< unsigned char > zipios::buffer_t

This type is used to declare a buffer of characters. It is used in many places.

Todo

Move to the zipios-config.hpp file so we can also use it in our public definitions?

Definition at line 98 of file zipios_common.hpp.

typedef std::streamoff zipios::offset_t

Definition at line 59 of file zipios-config.hpp.

std::ostringstream zipios::OutputStringStream

This object is used whenever we want to output a buffer from a string and convert that to a string.

Definition at line 95 of file zipios_common.hpp.

Enumeration Type Documentation

enum zipios::StorageMethod : uint8_t [strong]

The current entries are the types supported by the zip format. The numbering matches one to one the numbering used in the zip file format, i.e. STORED is indicated by a 0 in the method field in a zip file and so on.

The zipios library only support STORED and DEFLATED at this time.

Enumerator

STORED

SHRUNK

REDUCED1

REDUCED2

REDUCED3

REDUCED4

IMPLODED

TOKENIZED

DEFLATED

DEFLATED64

OLD_TERSE

RESERVED11

BZIP2

REVERVED13

LZMA

RESERVED15

RESERVED16

RESERVED17

NEW_TERSE

LZ77

WAVPACK

PPMD_I_1

Definition at line 47 of file fileentry.hpp.

Function Documentation

size_t zipios::getBufferSize () [inline]

Definition at line 62 of file zipios-config.hpp.

Referenced by zipios::DeflateOutputStreambuf::endDeflation(), zipios::DeflateOutputStreambuf::flushOutvec(), zipios::DeflateOutputStreambuf::init(), zipios::ZipOutputStreambuf::overflow(), zipios::DeflateOutputStreambuf::overflow(), zipios::ZipOutputStreambuf::putNextEntry(), zipios::InflateInputStreambuf::reset(), zipios::ZipInputStreambuf::underflow(), zipios::InflateInputStreambuf::underflow(), and zipios::ZipInputStreambuf::ZipInputStreambuf().

char const* zipios::getVersion () [inline]

Definition at line 53 of file zipios-config.hpp.

References ZIPIOS_VERSION_STRING.

Referenced by main().

std::ostream & zipios::operator<< (std::ostream & os, FilePath const & path)

This function prints out the name of the file that this FilePath represents.

Parameters:

os The output stream.
path The path to print out.

Returns:

A copy of the os stream reference.

Definition at line 502 of file filepath.cpp.

std::ostream & zipios::operator<< (std::ostream & os, FileCollection const & collection)

This function writes a simple textual representation of this FileCollection to the output stream.

Parameters:

os The output stream.
collection The collection to print out.

Returns:

A reference to the os output stream.

Definition at line 598 of file filecollection.cpp.

References zipios::FileCollection::entries(), and zipios::FileCollection::getName().

std::ostream & zipios::operator<< (std::ostream & os, FileEntry const & entry)

This function transforms the FileEntry into a string and prints the result to the specified output stream.

Parameters:

os The output stream.
entry The entry to print out.

Returns:

A reference to the output stream.

Definition at line 759 of file fileentry.cpp.

References zipios::FileEntry::toString().

bool zipios::operator== (char const * lhs, FilePath const & rhs)

This function compares a FilePath object (this) and a C-string to know whether the two are the same.

A null pointer as the C-string is viewed as an empty string.

Parameters:

lhs The left hand side to compare with.
rhs The right hand side to compare with.

See also:

operator == (FilePath const& rhs);

Definition at line 235 of file filepath.cpp.

References zipios::FilePath::m_path.

bool zipios::operator== (std::string const & lhs, FilePath const & rhs)

This function compares a FilePath object (this) against a string representing a path to know whether the two are the equal.

Parameters:

lhs The left hand side to compare with.
rhs The right hand side to compare with.

See also:

operator == (FilePath const& rhs);

Definition at line 268 of file filepath.cpp.

References zipios::FilePath::m_path.

void zipios::zipRead (std::istream & is, uint32_t & value)

Definition at line 74 of file zipios_common.cpp.

Referenced by zipios::ZipFile::openEmbeddedZipFile(), zipios::ZipCentralDirectoryEntry::read(), zipios::ZipEndOfCentralDirectory::read(), zipios::ZipLocalEntry::read(), and zipios::BackBuffer::readChunk().

void zipios::zipRead (std::istream & is, uint16_t & value)

Definition at line 95 of file zipios_common.cpp.

void zipios::zipRead (std::istream & is, uint8_t & value)

Definition at line 114 of file zipios_common.cpp.

void zipios::zipRead (std::istream & is, buffer_t & buffer, ssize_t const count)

Definition at line 132 of file zipios_common.cpp.

void zipios::zipRead (std::istream & is, std::string & str, ssize_t const count)

Definition at line 149 of file zipios_common.cpp.

void zipios::zipRead (buffer_t const & is, size_t & pos, uint32_t & value)

Definition at line 166 of file zipios_common.cpp.

void zipios::zipRead (buffer_t const & is, size_t & pos, uint16_t & value)

Definition at line 182 of file zipios_common.cpp.

void zipios::zipRead (buffer_t const & is, size_t & pos, uint8_t & value)

Definition at line 196 of file zipios_common.cpp.

void zipios::zipRead (buffer_t const & is, size_t & pos, buffer_t & buffer, ssize_t const count)

Definition at line 209 of file zipios_common.cpp.

void zipios::zipRead (buffer_t const & is, size_t & pos, std::string & str, ssize_t const count)

Definition at line 223 of file zipios_common.cpp.

void zipios::zipWrite (std::ostream & os, uint32_t const & value)

Definition at line 237 of file zipios_common.cpp.

Referenced by zipios::ZipCentralDirectoryEntry::write(), zipios::ZipEndOfCentralDirectory::write(), and zipios::ZipLocalEntry::write().

void zipios::zipWrite (std::ostream & os, uint16_t const & value)

Definition at line 253 of file zipios_common.cpp.

void zipios::zipWrite (std::ostream & os, uint8_t const & value)

Definition at line 267 of file zipios_common.cpp.

void zipios::zipWrite (std::ostream & os, buffer_t const & buffer)

Definition at line 280 of file zipios_common.cpp.

void zipios::zipWrite (std::ostream & os, std::string const & str)

Definition at line 289 of file zipios_common.cpp.

Variable Documentation

char const zipios::g_separator = '/'

This character is used to separate filename segments in a path in a Zip archive.

Todo

It is 'inadvertendly' also used as the separator between filename segments of the file system. We certainly want to support both '/' and '\\' to make sure MS-Windows is fully supported. The FilePath should take care of that work though.

Definition at line 51 of file zipios_common.cpp.

Referenced by zipios::FilePath::filename(), zipios::FilePath::operator+(), operator+=(), zipios::anonymous_namespace{filepath.cpp}::pruneTrailingSeparator(), zipios::ZipCentralDirectoryEntry::read(), zipios::ZipLocalEntry::read(), zipios::ZipCentralDirectoryEntry::write(), and zipios::ZipLocalEntry::write().

Author

Generated automatically by Doxygen for zipios from the source code.

Info

Mon Apr 11 2016 Version 2.1.1 zipios