LibreOffice Module package (master) 1
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
ZipPackageStream Class Referencefinal

#include <ZipPackageStream.hxx>

Inheritance diagram for ZipPackageStream:
[legend]
Collaboration diagram for ZipPackageStream:
[legend]

Public Types

enum class  Bugs {
  None ,
  WinEncodingWrongSHA1 ,
  WrongSHA1
}
 

Public Member Functions

bool IsPackageMember () const
 
bool IsFromManifest () const
 
void SetFromManifest (bool bValue)
 
::rtl::Reference< EncryptionDataGetEncryptionData (Bugs bugs=Bugs::None)
 
css::uno::Sequence< sal_Int8GetEncryptionKey (Bugs bugs=Bugs::None)
 
sal_Int32 GetStartKeyGenID () const
 
sal_Int32 GetEncryptionAlgorithm () const
 
sal_Int32 GetBlockSize () const
 
void SetToBeCompressed (bool bNewValue)
 
void SetIsEncrypted (bool bNewValue)
 
void SetImportedStartKeyAlgorithm (sal_Int32 nAlgorithm)
 
void SetImportedEncryptionAlgorithm (sal_Int32 nAlgorithm)
 
void SetImportedChecksumAlgorithm (sal_Int32 nAlgorithm)
 
void SetImportedDerivedKeySize (sal_Int32 nSize)
 
void SetToBeEncrypted (bool bNewValue)
 
void SetPackageMember (bool bNewValue)
 
void setInitialisationVector (const css::uno::Sequence< sal_Int8 > &rNewVector)
 
void setSalt (const css::uno::Sequence< sal_Int8 > &rNewSalt)
 
void setDigest (const css::uno::Sequence< sal_Int8 > &rNewDigest)
 
void setIterationCount (const sal_Int32 nNewCount)
 
void setSize (const sal_Int64 nNewSize)
 
 ZipPackageStream (ZipPackage &rNewPackage, const css::uno::Reference< css::uno::XComponentContext > &xContext, sal_Int32 nFormat, bool bAllowRemoveOnInsert)
 
virtual ~ZipPackageStream () override
 
css::uno::Reference< css::io::XInputStream > GetRawEncrStreamNoHeaderCopy ()
 
css::uno::Reference< css::io::XInputStream > TryToGetRawFromDataStream (bool bAddHeaderForEncr)
 
bool ParsePackageRawStream ()
 
virtual bool saveChild (const OUString &rPath, std::vector< css::uno::Sequence< css::beans::PropertyValue > > &rManList, ZipOutputStream &rZipOut, const css::uno::Sequence< sal_Int8 > &rEncryptionKey, sal_Int32 nPBKDF2IterationCount, const rtlRandomPool &rRandomPool) override
 
void setZipEntryOnLoading (const ZipEntry &rInEntry)
 
void successfullyWritten (ZipEntry const *pEntry)
 
virtual void SAL_CALL setInputStream (const css::uno::Reference< css::io::XInputStream > &aStream) override
 
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getInputStream () override
 
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getDataStream () override
 
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getRawStream () override
 
virtual void SAL_CALL setDataStream (const css::uno::Reference< css::io::XInputStream > &aStream) override
 
virtual void SAL_CALL setRawStream (const css::uno::Reference< css::io::XInputStream > &aStream) override
 
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getPlainRawStream () override
 
virtual void SAL_CALL setPropertyValue (const OUString &aPropertyName, const css::uno::Any &aValue) override
 
virtual css::uno::Any SAL_CALL getPropertyValue (const OUString &PropertyName) override
 
virtual OUString SAL_CALL getImplementationName () override
 
virtual sal_Bool SAL_CALL supportsService (const OUString &ServiceName) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 

Private Member Functions

css::uno::Reference< css::io::XInputStream > const & GetOwnSeekStream ()
 Check that m_xStream implements io::XSeekable and return it. More...
 
css::uno::Reference< css::io::XInputStream > getRawData ()
 get raw data using unbuffered stream More...
 

Private Attributes

css::uno::Reference< css::io::XInputStream > m_xStream
 
ZipPackagem_rZipPackage
 
bool m_bToBeCompressed
 
bool m_bToBeEncrypted
 
bool m_bHaveOwnKey
 
bool m_bIsEncrypted
 
::rtl::Reference< BaseEncryptionDatam_xBaseEncryptionData
 
css::uno::Sequence< css::beans::NamedValue > m_aStorageEncryptionKeys
 
css::uno::Sequence< sal_Int8m_aEncryptionKey
 
sal_Int32 m_nImportedStartKeyAlgorithm
 
sal_Int32 m_nImportedEncryptionAlgorithm
 
sal_Int32 m_nImportedChecksumAlgorithm
 
sal_Int32 m_nImportedDerivedKeySize
 
sal_uInt8 m_nStreamMode
 
sal_uInt32 m_nMagicalHackPos
 
sal_uInt32 m_nMagicalHackSize
 
sal_Int64 m_nOwnStreamOrigSize
 
bool m_bHasSeekable
 
bool m_bCompressedIsSetFromOutside
 
bool m_bFromManifest
 
bool m_bUseWinEncoding
 
bool m_bRawStream
 

Detailed Description

Definition at line 40 of file ZipPackageStream.hxx.

Member Enumeration Documentation

◆ Bugs

enum class ZipPackageStream::Bugs
strong
Enumerator
None 
WinEncodingWrongSHA1 
WrongSHA1 

Definition at line 84 of file ZipPackageStream.hxx.

Constructor & Destructor Documentation

◆ ZipPackageStream()

ZipPackageStream::ZipPackageStream ( ZipPackage rNewPackage,
const css::uno::Reference< css::uno::XComponentContext > &  xContext,
sal_Int32  nFormat,
bool  bAllowRemoveOnInsert 
)

Definition at line 76 of file ZipPackageStream.cxx.

References m_nFormat, and m_xContext.

◆ ~ZipPackageStream()

ZipPackageStream::~ZipPackageStream ( )
overridevirtual

Definition at line 115 of file ZipPackageStream.cxx.

Member Function Documentation

◆ GetBlockSize()

sal_Int32 ZipPackageStream::GetBlockSize ( ) const

Definition at line 187 of file ZipPackageStream.cxx.

References GetEncryptionAlgorithm().

Referenced by saveChild().

◆ getDataStream()

uno::Reference< io::XInputStream > SAL_CALL ZipPackageStream::getDataStream ( )
overridevirtual

◆ GetEncryptionAlgorithm()

sal_Int32 ZipPackageStream::GetEncryptionAlgorithm ( ) const

◆ GetEncryptionData()

rtl::Reference< EncryptionData > ZipPackageStream::GetEncryptionData ( Bugs  bugs = Bugs::None)

◆ GetEncryptionKey()

uno::Sequence< sal_Int8 > ZipPackageStream::GetEncryptionKey ( Bugs  bugs = Bugs::None)

◆ getImplementationName()

OUString ZipPackageStream::getImplementationName ( )
overridevirtual

Definition at line 1281 of file ZipPackageStream.cxx.

◆ getInputStream()

uno::Reference< io::XInputStream > SAL_CALL ZipPackageStream::getInputStream ( )
overridevirtual

◆ GetOwnSeekStream()

uno::Reference< io::XInputStream > const & ZipPackageStream::GetOwnSeekStream ( )
private

◆ getPlainRawStream()

uno::Reference< io::XInputStream > SAL_CALL ZipPackageStream::getPlainRawStream ( )
overridevirtual

◆ getPropertyValue()

Any SAL_CALL ZipPackageStream::getPropertyValue ( const OUString &  PropertyName)
overridevirtual

◆ getRawData()

uno::Reference< io::XInputStream > ZipPackageStream::getRawData ( )
private

get raw data using unbuffered stream

Exceptions
css::uno::RuntimeException

Definition at line 876 of file ZipPackageStream.cxx.

References Exception, GetEncryptionData(), GetOwnSeekStream(), ZipPackage::GetSharedMutexRef(), ZipPackage::getZipFile(), IsPackageMember(), m_bIsEncrypted, m_rZipPackage, and TOOLS_WARN_EXCEPTION.

Referenced by saveChild().

◆ GetRawEncrStreamNoHeaderCopy()

uno::Reference< io::XInputStream > ZipPackageStream::GetRawEncrStreamNoHeaderCopy ( )

◆ getRawStream()

uno::Reference< io::XInputStream > SAL_CALL ZipPackageStream::getRawStream ( )
overridevirtual

◆ GetStartKeyGenID()

sal_Int32 ZipPackageStream::GetStartKeyGenID ( ) const

◆ getSupportedServiceNames()

Sequence< OUString > ZipPackageStream::getSupportedServiceNames ( )
overridevirtual

Definition at line 1286 of file ZipPackageStream.cxx.

◆ IsFromManifest()

bool ZipPackageStream::IsFromManifest ( ) const
inline

Definition at line 81 of file ZipPackageStream.hxx.

References m_bFromManifest.

◆ IsPackageMember()

bool ZipPackageStream::IsPackageMember ( ) const
inline

◆ ParsePackageRawStream()

bool ZipPackageStream::ParsePackageRawStream ( )

◆ saveChild()

bool ZipPackageStream::saveChild ( const OUString &  rPath,
std::vector< css::uno::Sequence< css::beans::PropertyValue > > &  rManList,
ZipOutputStream rZipOut,
const css::uno::Sequence< sal_Int8 > &  rEncryptionKey,
sal_Int32  nPBKDF2IterationCount,
const rtlRandomPool rRandomPool 
)
overridevirtual

Definition at line 428 of file ZipPackageStream.cxx.

References ZipOutputStream::addDeflatingThreadTask(), aSeq, ZipOutputEntryInThread::createTask(), GetBlockSize(), GetEncryptionData(), getInputStream(), comphelper::ThreadPool::getPreferredConcurrency(), getRawData(), ZipOutputStream::getStream(), ZipOutputStream::getThreadTaskTag(), ImplSetStoredData(), IsPackageMember(), m_aEncryptionKey, m_aStorageEncryptionKeys, m_bHaveOwnKey, m_bIsEncrypted, m_bRawStream, m_bToBeCompressed, m_bToBeEncrypted, m_nFormat, m_nMagicalHackPos, m_nMagicalHackSize, m_nOwnStreamOrigSize, m_nStreamMode, m_xBaseEncryptionData, m_xContext, m_xStream, n_ConstBufferSize, ZipEntry::nCompressedSize, ZipEntry::nCrc, nLength, ZipEntry::nMethod, ZipEntry::nPathLen, ZipEntry::nSize, OUStringToOString(), PACKAGE_STREAM_DETECT, PACKAGE_STREAM_NOTSET, PACKAGE_STREAM_RAW, ParsePackageRawStream(), PKG_MNFST_DERKEYSIZE, PKG_MNFST_DIGEST, PKG_MNFST_DIGESTALG, PKG_MNFST_ENCALG, PKG_MNFST_FULLPATH, PKG_MNFST_INIVECTOR, PKG_MNFST_ITERATION, PKG_MNFST_MEDIATYPE, PKG_MNFST_SALT, PKG_MNFST_STARTALG, PKG_MNFST_UCOMPSIZE, PKG_MNFST_VERSION, PKG_SIZE_ENCR_MNFST, PKG_SIZE_NOENCR_MNFST, ZipOutputStream::rawCloseEntry(), ZipOutputStream::rawWrite(), ZipOutputStream::reduceScheduledThreadTasksToGivenNumberOrLess(), ZipOutputStream::setEntry(), setInitialisationVector(), SetIsEncrypted(), setIterationCount(), setSalt(), ZipEntry::sPath, successfullyWritten(), u, ZipOutputStream::writeLOC(), ZipOutputEntry::writeStream(), ZipOutputEntryParallel::writeStream(), and xStream.

◆ setDataStream()

void SAL_CALL ZipPackageStream::setDataStream ( const css::uno::Reference< css::io::XInputStream > &  aStream)
overridevirtual

Definition at line 1036 of file ZipPackageStream.cxx.

References m_nStreamMode, PACKAGE_STREAM_DATA, and setInputStream().

◆ setDigest()

void ZipPackageStream::setDigest ( const css::uno::Sequence< sal_Int8 > &  rNewDigest)
inline

Definition at line 114 of file ZipPackageStream.hxx.

References m_xBaseEncryptionData.

Referenced by ZipOutputEntryBase::closeEntry().

◆ SetFromManifest()

void ZipPackageStream::SetFromManifest ( bool  bValue)
inline

Definition at line 82 of file ZipPackageStream.hxx.

References m_bFromManifest.

◆ SetImportedChecksumAlgorithm()

void ZipPackageStream::SetImportedChecksumAlgorithm ( sal_Int32  nAlgorithm)
inline

Definition at line 98 of file ZipPackageStream.hxx.

References m_nImportedChecksumAlgorithm.

◆ SetImportedDerivedKeySize()

void ZipPackageStream::SetImportedDerivedKeySize ( sal_Int32  nSize)
inline

Definition at line 99 of file ZipPackageStream.hxx.

References m_nImportedDerivedKeySize.

◆ SetImportedEncryptionAlgorithm()

void ZipPackageStream::SetImportedEncryptionAlgorithm ( sal_Int32  nAlgorithm)
inline

Definition at line 97 of file ZipPackageStream.hxx.

References m_nImportedEncryptionAlgorithm.

◆ SetImportedStartKeyAlgorithm()

void ZipPackageStream::SetImportedStartKeyAlgorithm ( sal_Int32  nAlgorithm)
inline

Definition at line 96 of file ZipPackageStream.hxx.

References m_nImportedStartKeyAlgorithm.

◆ setInitialisationVector()

void ZipPackageStream::setInitialisationVector ( const css::uno::Sequence< sal_Int8 > &  rNewVector)
inline

Definition at line 110 of file ZipPackageStream.hxx.

References m_xBaseEncryptionData.

Referenced by saveChild().

◆ setInputStream()

void SAL_CALL ZipPackageStream::setInputStream ( const css::uno::Reference< css::io::XInputStream > &  aStream)
overridevirtual

◆ SetIsEncrypted()

void ZipPackageStream::SetIsEncrypted ( bool  bNewValue)
inline

Definition at line 95 of file ZipPackageStream.hxx.

References m_bIsEncrypted.

Referenced by ParsePackageRawStream(), and saveChild().

◆ setIterationCount()

void ZipPackageStream::setIterationCount ( const sal_Int32  nNewCount)
inline

Definition at line 116 of file ZipPackageStream.hxx.

References m_xBaseEncryptionData.

Referenced by saveChild().

◆ SetPackageMember()

void ZipPackageStream::SetPackageMember ( bool  bNewValue)

◆ setPropertyValue()

void SAL_CALL ZipPackageStream::setPropertyValue ( const OUString &  aPropertyName,
const css::uno::Any &  aValue 
)
overridevirtual

◆ setRawStream()

void SAL_CALL ZipPackageStream::setRawStream ( const css::uno::Reference< css::io::XInputStream > &  aStream)
overridevirtual

◆ setSalt()

void ZipPackageStream::setSalt ( const css::uno::Sequence< sal_Int8 > &  rNewSalt)
inline

Definition at line 112 of file ZipPackageStream.hxx.

References m_xBaseEncryptionData.

Referenced by saveChild().

◆ setSize()

void ZipPackageStream::setSize ( const sal_Int64  nNewSize)

Definition at line 1275 of file ZipPackageStream.cxx.

Referenced by successfullyWritten().

◆ SetToBeCompressed()

void ZipPackageStream::SetToBeCompressed ( bool  bNewValue)
inline

Definition at line 94 of file ZipPackageStream.hxx.

References m_bToBeCompressed.

◆ SetToBeEncrypted()

void ZipPackageStream::SetToBeEncrypted ( bool  bNewValue)
inline

Definition at line 100 of file ZipPackageStream.hxx.

References m_bToBeEncrypted, and m_xBaseEncryptionData.

Referenced by successfullyWritten().

◆ setZipEntryOnLoading()

void ZipPackageStream::setZipEntryOnLoading ( const ZipEntry rInEntry)

◆ successfullyWritten()

void ZipPackageStream::successfullyWritten ( ZipEntry const *  pEntry)

◆ supportsService()

sal_Bool SAL_CALL ZipPackageStream::supportsService ( const OUString &  ServiceName)
overridevirtual

Definition at line 1291 of file ZipPackageStream.cxx.

References cppu::supportsService().

◆ TryToGetRawFromDataStream()

uno::Reference< io::XInputStream > ZipPackageStream::TryToGetRawFromDataStream ( bool  bAddHeaderForEncr)

Member Data Documentation

◆ m_aEncryptionKey

css::uno::Sequence< sal_Int8 > ZipPackageStream::m_aEncryptionKey
private

◆ m_aStorageEncryptionKeys

css::uno::Sequence< css::beans::NamedValue > ZipPackageStream::m_aStorageEncryptionKeys
private

◆ m_bCompressedIsSetFromOutside

bool ZipPackageStream::m_bCompressedIsSetFromOutside
private

Definition at line 67 of file ZipPackageStream.hxx.

Referenced by setPropertyValue().

◆ m_bFromManifest

bool ZipPackageStream::m_bFromManifest
private

Definition at line 68 of file ZipPackageStream.hxx.

Referenced by IsFromManifest(), and SetFromManifest().

◆ m_bHasSeekable

bool ZipPackageStream::m_bHasSeekable
private

◆ m_bHaveOwnKey

bool ZipPackageStream::m_bHaveOwnKey
private

Definition at line 50 of file ZipPackageStream.hxx.

Referenced by GetEncryptionKey(), saveChild(), and setPropertyValue().

◆ m_bIsEncrypted

bool ZipPackageStream::m_bIsEncrypted
private

◆ m_bRawStream

bool ZipPackageStream::m_bRawStream
private

Definition at line 70 of file ZipPackageStream.hxx.

Referenced by saveChild(), and successfullyWritten().

◆ m_bToBeCompressed

bool ZipPackageStream::m_bToBeCompressed
private

◆ m_bToBeEncrypted

bool ZipPackageStream::m_bToBeEncrypted
private

◆ m_bUseWinEncoding

bool ZipPackageStream::m_bUseWinEncoding
private

Definition at line 69 of file ZipPackageStream.hxx.

Referenced by getDataStream(), and GetEncryptionKey().

◆ m_nImportedChecksumAlgorithm

sal_Int32 ZipPackageStream::m_nImportedChecksumAlgorithm
private

◆ m_nImportedDerivedKeySize

sal_Int32 ZipPackageStream::m_nImportedDerivedKeySize
private

◆ m_nImportedEncryptionAlgorithm

sal_Int32 ZipPackageStream::m_nImportedEncryptionAlgorithm
private

◆ m_nImportedStartKeyAlgorithm

sal_Int32 ZipPackageStream::m_nImportedStartKeyAlgorithm
private

◆ m_nMagicalHackPos

sal_uInt32 ZipPackageStream::m_nMagicalHackPos
private

Definition at line 62 of file ZipPackageStream.hxx.

Referenced by ParsePackageRawStream(), saveChild(), and SetPackageMember().

◆ m_nMagicalHackSize

sal_uInt32 ZipPackageStream::m_nMagicalHackSize
private

Definition at line 63 of file ZipPackageStream.hxx.

Referenced by ParsePackageRawStream(), saveChild(), and SetPackageMember().

◆ m_nOwnStreamOrigSize

sal_Int64 ZipPackageStream::m_nOwnStreamOrigSize
private

Definition at line 64 of file ZipPackageStream.hxx.

Referenced by saveChild(), and successfullyWritten().

◆ m_nStreamMode

sal_uInt8 ZipPackageStream::m_nStreamMode
private

◆ m_rZipPackage

ZipPackage& ZipPackageStream::m_rZipPackage
private

◆ m_xBaseEncryptionData

::rtl::Reference< BaseEncryptionData > ZipPackageStream::m_xBaseEncryptionData
private

◆ m_xStream

css::uno::Reference< css::io::XInputStream > ZipPackageStream::m_xStream
private

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