19#ifndef INCLUDED_PACKAGE_INC_ZIPFILE_HXX
20#define INCLUDED_PACKAGE_INC_ZIPFILE_HXX
22#include <com/sun/star/xml/crypto/XCipherContext.hpp>
23#include <com/sun/star/xml/crypto/XDigestContext.hpp>
34 namespace uno {
class XComponentContext; }
35 namespace ucb {
class XProgressHandler; }
46#define ZIP_MAXNAMELEN 512
47#define ZIP_MAXENTRIES (0x10000 - 2)
58 css::uno::Reference < css::io::XInputStream > xStream;
59 const css::uno::Reference < css::uno::XComponentContext > m_xContext;
64 css::uno::Reference < css::io::XInputStream > createStreamForZipEntry(
67 const ::rtl::Reference < EncryptionData > &rData,
70 const bool bUseBufferedStream =
true,
71 const OUString& aMediaType = OUString() );
75 bool checkSizeAndCRC(
const ZipEntry& aEntry );
77 sal_Int32 getCRC( sal_Int64 nOffset, sal_Int64 nSize );
79 void getSizeAndCRC( sal_Int64 nOffset, sal_Int64 nCompressedSize, sal_Int64 *nSize, sal_Int32 *nCRC );
86 sal_uInt64& nSize, sal_uInt64& nCompressedSize,
92 css::uno::Reference < css::io::XInputStream >
const &xInput,
93 css::uno::Reference < css::uno::XComponentContext > xContext,
97 css::uno::Reference < css::io::XInputStream >
const &xInput,
98 css::uno::Reference < css::uno::XComponentContext > xContext,
100 bool bForceRecover );
106 void setInputStream (
const css::uno::Reference < css::io::XInputStream >& xNewStream );
107 css::uno::Reference< css::io::XInputStream > getRawData(
109 const ::rtl::Reference < EncryptionData > &rData,
112 const bool bUseBufferedStream =
true );
114 static css::uno::Reference< css::xml::crypto::XDigestContext > StaticGetDigestContextForChecksum(
115 const css::uno::Reference< css::uno::XComponentContext >& xArgContext,
116 const ::rtl::Reference< EncryptionData >& xEncryptionData );
118 static css::uno::Reference< css::xml::crypto::XCipherContext > StaticGetCipher(
119 const css::uno::Reference< css::uno::XComponentContext >& xArgContext,
120 const ::rtl::Reference< EncryptionData >& xEncryptionData,
123 static void StaticFillHeader ( const ::rtl::Reference < EncryptionData > & rData,
125 const OUString& aMediaType,
129 sal_Int32 &rEncAlgorithm,
130 sal_Int32 &rChecksumAlgorithm,
131 sal_Int32 &rDerivedKeySize,
132 sal_Int32 &rStartKeyGenID,
134 OUString& aMediaType,
135 const css::uno::Reference < css::io::XInputStream >& rStream );
137 static css::uno::Reference< css::io::XInputStream > StaticGetDataFromRawStream(
139 const css::uno::Reference< css::uno::XComponentContext >& rxContext,
140 const css::uno::Reference< css::io::XInputStream >& xStream,
141 const ::rtl::Reference < EncryptionData > &rData );
143 static bool StaticHasValidPassword (
144 const css::uno::Reference< css::uno::XComponentContext >& rxContext,
145 const css::uno::Sequence< sal_Int8 > &aReadBuffer,
146 const ::rtl::Reference < EncryptionData > &rData );
148 css::uno::Reference< css::io::XInputStream > getInputStream(
150 const ::rtl::Reference < EncryptionData > &rData,
154 css::uno::Reference< css::io::XInputStream > getDataStream(
156 const ::rtl::Reference < EncryptionData > &rData,
160 css::uno::Reference< css::io::XInputStream > getWrappedRawStream(
162 const ::rtl::Reference < EncryptionData > &rData,
163 const OUString& aMediaType,
std::unordered_map< OUString, ZipEntry > EntryHash
ZipFile(const Filepath_t &FileName)
ScXMLEditAttributeMap::Entry const aEntries[]