LibreOffice Module sc (master)  1
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
XclImpDecrypter Class Referenceabstract

Base class for BIFF stream decryption. More...

#include <xistream.hxx>

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

Public Member Functions

 XclImpDecrypter ()
 
virtual ~XclImpDecrypter () override
 
const ErrCodeGetError () const
 Returns the current error code of the decrypter. More...
 
bool IsValid () const
 Returns true, if the decoder has been initialized correctly. More...
 
XclImpDecrypterRef Clone () const
 Creates a (ref-counted) copy of this decrypter object. More...
 
virtual ::comphelper::DocPasswordVerifierResult verifyPassword (const OUString &rPassword, css::uno::Sequence< css::beans::NamedValue > &o_rEncryptionData) override
 Implementation of the comphelper::IDocPasswordVerifier interface. More...
 
virtual ::comphelper::DocPasswordVerifierResult verifyEncryptionData (const css::uno::Sequence< css::beans::NamedValue > &rEncryptionData) override
 
void Update (const SvStream &rStrm, sal_uInt16 nRecSize)
 Updates the decrypter on start of a new record or after seeking stream. More...
 
sal_uInt16 Read (SvStream &rStrm, void *pData, sal_uInt16 nBytes)
 Reads and decrypts nBytes bytes and stores data into the existing(!) buffer pData. More...
 
- Public Member Functions inherited from comphelper::IDocPasswordVerifier
virtual ~IDocPasswordVerifier ()
 

Protected Member Functions

 XclImpDecrypter (const XclImpDecrypter &rSrc)
 Protected copy c'tor for OnClone(). More...
 

Private Member Functions

virtual XclImpDecrypterOnClone () const =0
 Implementation of cloning this object. More...
 
virtual css::uno::Sequence< css::beans::NamedValue > OnVerifyPassword (const OUString &rPassword)=0
 Derived classes implement password verification and initialization of the decoder. More...
 
virtual bool OnVerifyEncryptionData (const css::uno::Sequence< css::beans::NamedValue > &rEncryptionData)=0
 
virtual void OnUpdate (std::size_t nOldStrmPos, std::size_t nNewStrmPos, sal_uInt16 nRecSize)=0
 Implementation of updating the decrypter. More...
 
virtual sal_uInt16 OnRead (SvStream &rStrm, sal_uInt8 *pnData, sal_uInt16 nBytes)=0
 Implementation of the decryption. More...
 

Private Attributes

ErrCode mnError
 
sal_uInt64 mnOldPos
 Decrypter error code. More...
 
sal_uInt16 mnRecSize
 Last known stream position. More...
 

Detailed Description

Base class for BIFF stream decryption.

Definition at line 45 of file xistream.hxx.

Constructor & Destructor Documentation

XclImpDecrypter::XclImpDecrypter ( )
explicit

Definition at line 37 of file xistream.cxx.

References STREAM_SEEK_TO_END.

XclImpDecrypter::~XclImpDecrypter ( )
overridevirtual

Definition at line 52 of file xistream.cxx.

XclImpDecrypter::XclImpDecrypter ( const XclImpDecrypter rSrc)
explicitprotected

Protected copy c'tor for OnClone().

Definition at line 44 of file xistream.cxx.

References STREAM_SEEK_TO_END.

Member Function Documentation

XclImpDecrypterRef XclImpDecrypter::Clone ( ) const

Creates a (ref-counted) copy of this decrypter object.

Definition at line 56 of file xistream.cxx.

References IsValid(), and OnClone().

const ErrCode& XclImpDecrypter::GetError ( ) const
inline

Returns the current error code of the decrypter.

Definition at line 52 of file xistream.hxx.

References mnError.

bool XclImpDecrypter::IsValid ( ) const
inline

Returns true, if the decoder has been initialized correctly.

Definition at line 54 of file xistream.hxx.

References ERRCODE_NONE, and mnError.

Referenced by Clone(), Read(), Update(), XclImpBiff5Decrypter::XclImpBiff5Decrypter(), XclImpBiff8CryptoAPIDecrypter::XclImpBiff8CryptoAPIDecrypter(), and XclImpBiff8StdDecrypter::XclImpBiff8StdDecrypter().

virtual XclImpDecrypter* XclImpDecrypter::OnClone ( ) const
privatepure virtual

Implementation of cloning this object.

Implemented in XclImpBiff8CryptoAPIDecrypter, XclImpBiff8StdDecrypter, and XclImpBiff5Decrypter.

Referenced by Clone().

virtual sal_uInt16 XclImpDecrypter::OnRead ( SvStream rStrm,
sal_uInt8 pnData,
sal_uInt16  nBytes 
)
privatepure virtual

Implementation of the decryption.

Implemented in XclImpBiff8Decrypter, and XclImpBiff5Decrypter.

Referenced by Read().

virtual void XclImpDecrypter::OnUpdate ( std::size_t  nOldStrmPos,
std::size_t  nNewStrmPos,
sal_uInt16  nRecSize 
)
privatepure virtual

Implementation of updating the decrypter.

Implemented in XclImpBiff8Decrypter, and XclImpBiff5Decrypter.

Referenced by Update().

virtual bool XclImpDecrypter::OnVerifyEncryptionData ( const css::uno::Sequence< css::beans::NamedValue > &  rEncryptionData)
privatepure virtual
virtual css::uno::Sequence< css::beans::NamedValue > XclImpDecrypter::OnVerifyPassword ( const OUString &  rPassword)
privatepure virtual

Derived classes implement password verification and initialization of the decoder.

Implemented in XclImpBiff8Decrypter, and XclImpBiff5Decrypter.

Referenced by verifyPassword().

sal_uInt16 XclImpDecrypter::Read ( SvStream rStrm,
void pData,
sal_uInt16  nBytes 
)

Reads and decrypts nBytes bytes and stores data into the existing(!) buffer pData.

Returns
Count of bytes really read.

Definition at line 92 of file xistream.cxx.

References IsValid(), mnOldPos, mnRecSize, OnRead(), SvStream::ReadBytes(), SvStream::Tell(), and Update().

void XclImpDecrypter::Update ( const SvStream rStrm,
sal_uInt16  nRecSize 
)

Updates the decrypter on start of a new record or after seeking stream.

Definition at line 78 of file xistream.cxx.

References IsValid(), mnOldPos, mnRecSize, OnUpdate(), and SvStream::Tell().

Referenced by Read().

comphelper::DocPasswordVerifierResult XclImpDecrypter::verifyEncryptionData ( const css::uno::Sequence< css::beans::NamedValue > &  rEncryptionData)
overridevirtual
comphelper::DocPasswordVerifierResult XclImpDecrypter::verifyPassword ( const OUString &  rPassword,
css::uno::Sequence< css::beans::NamedValue > &  o_rEncryptionData 
)
overridevirtual

Implementation of the comphelper::IDocPasswordVerifier interface.

Implements comphelper::IDocPasswordVerifier.

Definition at line 64 of file xistream.cxx.

References ERRCODE_ABORT, ERRCODE_NONE, mnError, and OnVerifyPassword().

Member Data Documentation

ErrCode XclImpDecrypter::mnError
private

Definition at line 88 of file xistream.hxx.

Referenced by GetError(), IsValid(), verifyEncryptionData(), and verifyPassword().

sal_uInt64 XclImpDecrypter::mnOldPos
private

Decrypter error code.

Definition at line 89 of file xistream.hxx.

Referenced by Read(), and Update().

sal_uInt16 XclImpDecrypter::mnRecSize
private

Last known stream position.

Definition at line 90 of file xistream.hxx.

Referenced by Read(), and Update().


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