LibreOffice Module package (master) 1
|
#include <ZipOutputStream.hxx>
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::ThreadTaskTag > | mpThreadTaskTag |
ByteChucker | m_aChucker |
ZipEntry * | m_pCurrentEntry |
std::vector< ZipOutputEntryInThread * > | m_aEntries |
std::exception_ptr | m_aDeflateException |
Definition at line 37 of file ZipOutputStream.hxx.
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 | ( | ) |
Definition at line 52 of file ZipOutputStream.cxx.
void ZipOutputStream::addDeflatingThreadTask | ( | ZipOutputEntryInThread * | pEntry, |
std::unique_ptr< comphelper::ThreadTask > | pThreadTask | ||
) |
Definition at line 72 of file ZipOutputStream.cxx.
References comphelper::ThreadPool::getSharedOptimalPool(), m_aEntries, and comphelper::ThreadPool::pushTask().
Referenced by ZipPackageStream::saveChild().
|
private |
Definition at line 128 of file ZipOutputStream.cxx.
References consumeScheduledThreadTaskEntry(), and m_aEntries.
Referenced by reduceScheduledThreadTasksToGivenNumberOrLess().
|
private |
Definition at line 95 of file ZipOutputStream.cxx.
References m_aDeflateException, n_ConstBufferSize, rawCloseEntry(), rawWrite(), and writeLOC().
Referenced by consumeFinishedScheduledThreadTaskEntries(), and finish().
void ZipOutputStream::finish | ( | ) |
css::io::IOException | |
css::uno::RuntimeException |
Definition at line 161 of file ZipOutputStream.cxx.
References consumeScheduledThreadTaskEntry(), ByteChucker::GetPosition(), comphelper::ThreadPool::getSharedOptimalPool(), m_aChucker, m_aDeflateException, m_aEntries, m_aZipList, mpThreadTaskTag, p, comphelper::ThreadPool::waitUntilDone(), writeCEN(), and writeEND().
Referenced by ZipPackage::writeTempFile().
|
static |
Definition at line 340 of file ZipOutputStream.cxx.
Referenced by setEntry(), ZipPackage::WriteContentTypes(), ZipPackage::WriteManifest(), and ZipPackage::WriteMimetypeMagicFile().
const css::uno::Reference< css::io::XOutputStream > & ZipOutputStream::getStream | ( | ) | const |
Definition at line 191 of file ZipOutputStream.cxx.
References m_xStream.
Referenced by ZipPackageStream::saveChild(), ZipPackage::WriteContentTypes(), and ZipPackage::WriteManifest().
|
inline |
Definition at line 93 of file ZipOutputStream.hxx.
References mpThreadTaskTag.
Referenced by ZipPackageStream::saveChild().
void ZipOutputStream::rawCloseEntry | ( | bool | bEncrypt = false | ) |
css::io::IOException | |
css::uno::RuntimeException |
Definition at line 83 of file ZipOutputStream.cxx.
References m_pCurrentEntry, ZipEntry::nFlag, ZipEntry::nMethod, and writeDataDescriptor().
Referenced by consumeScheduledThreadTaskEntry(), ZipPackageStream::saveChild(), ZipPackageFolder::saveContents(), ZipPackage::WriteContentTypes(), ZipPackage::WriteManifest(), and ZipPackage::WriteMimetypeMagicFile().
void ZipOutputStream::rawWrite | ( | const css::uno::Sequence< sal_Int8 > & | rBuffer | ) |
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().
void ZipOutputStream::reduceScheduledThreadTasksToGivenNumberOrLess | ( | std::size_t | nThreadTasks | ) |
Definition at line 148 of file ZipOutputStream.cxx.
References consumeFinishedScheduledThreadTaskEntries(), and m_aEntries.
Referenced by ZipPackageStream::saveChild().
|
static |
Definition at line 56 of file ZipOutputStream.cxx.
References getCurrentDosTime(), ZipEntry::nCompressedSize, ZipEntry::nCrc, ZipEntry::nFlag, ZipEntry::nMethod, ZipEntry::nSize, ZipEntry::nTime, and ZipEntry::nVersion.
Referenced by ZipPackageStream::saveChild(), ZipPackageFolder::saveContents(), ZipPackage::WriteContentTypes(), ZipPackage::WriteManifest(), and ZipPackage::WriteMimetypeMagicFile().
|
private |
css::io::IOException | |
css::uno::RuntimeException |
Definition at line 219 of file ZipOutputStream.cxx.
References getTruncated(), comphelper::OStorageHelper::IsValidZipEntryFileName(), m_aChucker, ZipEntry::nCompressedSize, ZipEntry::nCrc, ZipEntry::nFlag, ZipEntry::nMethod, ZipEntry::nOffset, ZipEntry::nSize, ZipEntry::nTime, ZipEntry::nVersion, OUStringToOString(), ZipEntry::sPath, ByteChucker::WriteBytes(), writeExtraFields(), ByteChucker::WriteInt16(), ByteChucker::WriteInt32(), and ByteChucker::WriteUInt32().
Referenced by finish().
|
private |
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().
|
private |
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().
|
private |
Definition at line 277 of file ZipOutputStream.cxx.
References m_aChucker, ZipEntry::nCompressedSize, ZipEntry::nOffset, ZipEntry::nSize, ByteChucker::WriteInt16(), ByteChucker::WriteInt32(), and ByteChucker::WriteUInt64().
Referenced by writeCEN(), and writeLOC().
void ZipOutputStream::writeLOC | ( | ZipEntry * | pEntry, |
bool | bEncrypt = false |
||
) |
css::io::IOException | |
css::uno::RuntimeException |
Definition at line 288 of file ZipOutputStream.cxx.
References ByteChucker::GetPosition(), getTruncated(), comphelper::OStorageHelper::IsValidZipEntryFileName(), m_aChucker, m_aZipList, m_pCurrentEntry, ZipEntry::nCompressedSize, ZipEntry::nCrc, ZipEntry::nFlag, ZipEntry::nMethod, ZipEntry::nOffset, ZipEntry::nSize, ZipEntry::nTime, ZipEntry::nVersion, OUStringToOString(), ZipEntry::sPath, ByteChucker::WriteBytes(), writeExtraFields(), ByteChucker::WriteInt16(), ByteChucker::WriteInt32(), and ByteChucker::WriteUInt32().
Referenced by consumeScheduledThreadTaskEntry(), ZipPackageStream::saveChild(), ZipPackageFolder::saveContents(), ZipPackage::WriteContentTypes(), ZipPackage::WriteManifest(), and ZipPackage::WriteMimetypeMagicFile().
|
private |
Definition at line 43 of file ZipOutputStream.hxx.
Referenced by finish(), rawWrite(), writeCEN(), writeDataDescriptor(), writeEND(), writeExtraFields(), and writeLOC().
|
private |
Definition at line 46 of file ZipOutputStream.hxx.
Referenced by consumeScheduledThreadTaskEntry(), and finish().
|
private |
Definition at line 45 of file ZipOutputStream.hxx.
Referenced by addDeflatingThreadTask(), consumeFinishedScheduledThreadTaskEntries(), finish(), and reduceScheduledThreadTasksToGivenNumberOrLess().
|
private |
Definition at line 40 of file ZipOutputStream.hxx.
Referenced by finish(), writeEND(), and writeLOC().
|
private |
Definition at line 44 of file ZipOutputStream.hxx.
Referenced by rawCloseEntry(), and writeLOC().
|
private |
Definition at line 39 of file ZipOutputStream.hxx.
Referenced by getStream().
|
private |
Definition at line 41 of file ZipOutputStream.hxx.
Referenced by finish(), and getThreadTaskTag().