145 , m_is_directory(src.isDirectory())
210 ZipLocalEntry const *
const ze(dynamic_cast<ZipLocalEntry const * const>(&file_entry));
349 is.setstate(std::ios::failbit);
350 throw IOException(
"ZipLocalEntry::read() expected a signature but got some other data");
353 uint16_t compress_method(0);
355 uint32_t compressed_size(0);
356 uint32_t uncompressed_size(0);
357 uint16_t filename_len(0);
358 uint16_t extra_field_len(0);
359 std::string filename;
368 zipRead(is, uncompressed_size);
371 zipRead(is, filename, filename_len);
408 throw InvalidStateException(
"ZipLocalEntry::write(): file name or extra field too large to save in a Zip file.");
442 uint16_t filename_len(filename.length());
StorageMethod m_compress_method
virtual void setCompressedSize(size_t size) override
Set the size when the file is compressed.
Various exceptions used throughout the Zipios++ library, all based on zipios::Exception.
void zipRead(std::istream &is, uint32_t &value)
CompressionLevel m_compression_level
StorageMethod
The types used with FileEntry::setMethod and FileEntry::getMethod.
virtual size_t getHeaderSize() const override
Retrieve the size of the header.
An implementation of the FileEntry for Zip archives.
uint32_t const g_signature
The signature of a local entry.
dostime_t unix2dostime(time_t unix_time)
Convert a Unix date to a DOS date.
virtual pointer_t clone() const override
Create a clone of a ZipLocalEntry object.
static CompressionLevel const COMPRESSION_LEVEL_NONE
virtual bool isDirectory() const override
Check whether the filename represents a directory.
ZipLocalEntry()
Create a default ZipLocalEntry objects.
virtual bool isEqual(FileEntry const &file_entry) const
Compare two file entries for equality.
void zipWrite(std::ostream &os, uint32_t const &value)
dostime_t dostime(int year, int month, int day, int hour, int minute, int second)
virtual size_t getCompressedSize() const override
Retrive the size of the file when compressed.
char const g_separator
The character used as the filename separator.
An IOException is used to signal an I/O error.
virtual void write(std::ostream &os) override
Write a ZipLocalEntry to os.
bool hasTrailingDataDescriptor() const
Is there a trailing data descriptor?
Declare the zipios::ZipLocalEntry class used to handle Zip entries.
virtual void setCrc(crc32_t crc) override
Save the CRC of the entry.
time_t dos2unixtime(dostime_t dostime)
Convert a DOS time to a Unix time.
A FileEntry represents an entry in a FileCollection.
Exception used when it is not possible to move forward.
virtual void read(std::istream &is) override
Read one local entry from is.
uint16_t m_general_purpose_bitfield
Handle a file path and name and its statistics.
Definitions for the MS-DOS to Unix time conversions.
Various functions used throughout the library.
size_t length() const
Get the length of the string.
uint16_t const g_trailing_data_descriptor
A bit in the general purpose flags.
virtual ~ZipLocalEntry() override
Clean up a ZipLocalEntry object.
virtual bool isEqual(FileEntry const &file_entry) const override
Compare two file entries for equality.
uint16_t m_extract_version
size_t m_uncompressed_size
std::shared_ptr< FileEntry > pointer_t