LibreOffice Module package (master) 1
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
ZipOutputStream Class Reference

#include <ZipOutputStream.hxx>

Collaboration diagram for ZipOutputStream:
[legend]

Public Member Functions

 ZipOutputStream (const css::uno::Reference< css::io::XOutputStream > &xOStream)
 This class is used to write Zip files. More...
 
 ~ZipOutputStream ()
 
void addDeflatingThreadTask (ZipOutputEntryInThread *pEntry, std::unique_ptr< comphelper::ThreadTask > pThreadTask)
 
void writeLOC (ZipEntry *pEntry, bool bEncrypt=false)
 
void rawWrite (const css::uno::Sequence< sal_Int8 > &rBuffer)
 
void rawCloseEntry (bool bEncrypt=false)
 
void finish ()
 
const css::uno::Reference< css::io::XOutputStream > & getStream () const
 
void reduceScheduledThreadTasksToGivenNumberOrLess (std::size_t nThreadTasks)
 
const std::shared_ptr< comphelper::ThreadTaskTag > & getThreadTaskTag () const
 

Static Public Member Functions

static sal_uInt32 getCurrentDosTime ()
 
static void setEntry (ZipEntry *pEntry)
 

Private Member Functions

void writeEND (sal_uInt32 nOffset, sal_uInt32 nLength)
 
void writeCEN (const ZipEntry &rEntry)
 
void writeDataDescriptor (const ZipEntry &rEntry)
 
void writeExtraFields (const ZipEntry &rEntry)
 
void consumeScheduledThreadTaskEntry (std::unique_ptr< ZipOutputEntryInThread > pCandidate)
 
void consumeFinishedScheduledThreadTaskEntries ()
 

Private Attributes

css::uno::Reference< css::io::XOutputStream > m_xStream
 
::std::vector< ZipEntry * > m_aZipList
 
std::shared_ptr< comphelper::ThreadTaskTagmpThreadTaskTag
 
ByteChucker m_aChucker
 
ZipEntrym_pCurrentEntry
 
std::vector< ZipOutputEntryInThread * > m_aEntries
 
std::exception_ptr m_aDeflateException
 

Detailed Description

Definition at line 37 of file ZipOutputStream.hxx.

Constructor & Destructor Documentation

◆ ZipOutputStream()

ZipOutputStream::ZipOutputStream ( const css::uno::Reference< css::io::XOutputStream > &  xOStream)

This class is used to write Zip files.

Definition at line 44 of file ZipOutputStream.cxx.

References m_xStream.

◆ ~ZipOutputStream()

ZipOutputStream::~ZipOutputStream ( )

Definition at line 52 of file ZipOutputStream.cxx.

Member Function Documentation

◆ addDeflatingThreadTask()

void ZipOutputStream::addDeflatingThreadTask ( ZipOutputEntryInThread pEntry,
std::unique_ptr< comphelper::ThreadTask pThreadTask 
)

◆ consumeFinishedScheduledThreadTaskEntries()

void ZipOutputStream::consumeFinishedScheduledThreadTaskEntries ( )
private

◆ consumeScheduledThreadTaskEntry()

void ZipOutputStream::consumeScheduledThreadTaskEntry ( std::unique_ptr< ZipOutputEntryInThread pCandidate)
private

◆ finish()

void ZipOutputStream::finish ( )

◆ getCurrentDosTime()

sal_uInt32 ZipOutputStream::getCurrentDosTime ( )
static

◆ getStream()

const css::uno::Reference< css::io::XOutputStream > & ZipOutputStream::getStream ( ) const

◆ getThreadTaskTag()

const std::shared_ptr< comphelper::ThreadTaskTag > & ZipOutputStream::getThreadTaskTag ( ) const
inline

Definition at line 93 of file ZipOutputStream.hxx.

References mpThreadTaskTag.

Referenced by ZipPackageStream::saveChild().

◆ rawCloseEntry()

void ZipOutputStream::rawCloseEntry ( bool  bEncrypt = false)

◆ rawWrite()

void ZipOutputStream::rawWrite ( const css::uno::Sequence< sal_Int8 > &  rBuffer)
Exceptions
css::io::IOException
css::uno::RuntimeException

Definition at line 78 of file ZipOutputStream.cxx.

References m_aChucker, and ByteChucker::WriteBytes().

Referenced by consumeScheduledThreadTaskEntry(), ZipPackageStream::saveChild(), and ZipPackage::WriteMimetypeMagicFile().

◆ reduceScheduledThreadTasksToGivenNumberOrLess()

void ZipOutputStream::reduceScheduledThreadTasksToGivenNumberOrLess ( std::size_t  nThreadTasks)

◆ setEntry()

void ZipOutputStream::setEntry ( ZipEntry pEntry)
static

◆ writeCEN()

void ZipOutputStream::writeCEN ( const ZipEntry rEntry)
private

◆ writeDataDescriptor()

void ZipOutputStream::writeDataDescriptor ( const ZipEntry rEntry)
private
Exceptions
css::io::IOException
css::uno::RuntimeException

Definition at line 256 of file ZipOutputStream.cxx.

References m_aChucker, ZipEntry::nCompressedSize, ZipEntry::nCrc, ZipEntry::nSize, ByteChucker::WriteInt32(), ByteChucker::WriteUInt32(), and ByteChucker::WriteUInt64().

Referenced by rawCloseEntry().

◆ writeEND()

void ZipOutputStream::writeEND ( sal_uInt32  nOffset,
sal_uInt32  nLength 
)
private
Exceptions
css::io::IOException
css::uno::RuntimeException

Definition at line 196 of file ZipOutputStream.cxx.

References m_aChucker, m_aZipList, nLength, ByteChucker::WriteInt16(), ByteChucker::WriteInt32(), and ByteChucker::WriteUInt32().

Referenced by finish().

◆ writeExtraFields()

void ZipOutputStream::writeExtraFields ( const ZipEntry rEntry)
private

◆ writeLOC()

void ZipOutputStream::writeLOC ( ZipEntry pEntry,
bool  bEncrypt = false 
)

Member Data Documentation

◆ m_aChucker

ByteChucker ZipOutputStream::m_aChucker
private

◆ m_aDeflateException

std::exception_ptr ZipOutputStream::m_aDeflateException
private

Definition at line 46 of file ZipOutputStream.hxx.

Referenced by consumeScheduledThreadTaskEntry(), and finish().

◆ m_aEntries

std::vector< ZipOutputEntryInThread* > ZipOutputStream::m_aEntries
private

◆ m_aZipList

::std::vector< ZipEntry * > ZipOutputStream::m_aZipList
private

Definition at line 40 of file ZipOutputStream.hxx.

Referenced by finish(), writeEND(), and writeLOC().

◆ m_pCurrentEntry

ZipEntry* ZipOutputStream::m_pCurrentEntry
private

Definition at line 44 of file ZipOutputStream.hxx.

Referenced by rawCloseEntry(), and writeLOC().

◆ m_xStream

css::uno::Reference< css::io::XOutputStream > ZipOutputStream::m_xStream
private

Definition at line 39 of file ZipOutputStream.hxx.

Referenced by getStream().

◆ mpThreadTaskTag

std::shared_ptr<comphelper::ThreadTaskTag> ZipOutputStream::mpThreadTaskTag
private

Definition at line 41 of file ZipOutputStream.hxx.

Referenced by finish(), and getThreadTaskTag().


The documentation for this class was generated from the following files: