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 ()
 
virtual DocPasswordVerifierResult verifyPassword (const OUString &rPassword, css::uno::Sequence< css::beans::NamedValue > &o_rEncryptionData)=0
 
virtual DocPasswordVerifierResult verifyEncryptionData (const css::uno::Sequence< css::beans::NamedValue > &o_rEncryptionData)=0
 

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 44 of file xistream.hxx.

Constructor & Destructor Documentation

◆ XclImpDecrypter() [1/2]

XclImpDecrypter::XclImpDecrypter ( )
explicit

Definition at line 38 of file xistream.cxx.

References STREAM_SEEK_TO_END.

◆ ~XclImpDecrypter()

XclImpDecrypter::~XclImpDecrypter ( )
overridevirtual

Definition at line 53 of file xistream.cxx.

◆ XclImpDecrypter() [2/2]

XclImpDecrypter::XclImpDecrypter ( const XclImpDecrypter rSrc)
explicitprotected

Protected copy c'tor for OnClone().

Definition at line 45 of file xistream.cxx.

References STREAM_SEEK_TO_END.

Member Function Documentation

◆ Clone()

XclImpDecrypterRef XclImpDecrypter::Clone ( ) const

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

Definition at line 57 of file xistream.cxx.

References IsValid(), and OnClone().

◆ GetError()

const ErrCode & XclImpDecrypter::GetError ( ) const
inline

Returns the current error code of the decrypter.

Definition at line 51 of file xistream.hxx.

References mnError.

◆ IsValid()

bool XclImpDecrypter::IsValid ( ) const
inline

Returns true, if the decoder has been initialized correctly.

Definition at line 53 of file xistream.hxx.

References ERRCODE_NONE, and mnError.

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

◆ OnClone()

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

Implementation of cloning this object.

Implemented in XclImpBiff5Decrypter, XclImpBiff8StdDecrypter, and XclImpBiff8CryptoAPIDecrypter.

Referenced by Clone().

◆ OnRead()

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

Implementation of the decryption.

Implemented in XclImpBiff5Decrypter, and XclImpBiff8Decrypter.

Referenced by Read().

◆ OnUpdate()

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

Implementation of updating the decrypter.

Implemented in XclImpBiff5Decrypter, and XclImpBiff8Decrypter.

Referenced by Update().

◆ OnVerifyEncryptionData()

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

◆ OnVerifyPassword()

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 XclImpBiff5Decrypter, and XclImpBiff8Decrypter.

Referenced by verifyPassword().

◆ Read()

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 93 of file xistream.cxx.

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

◆ 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 79 of file xistream.cxx.

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

Referenced by Read().

◆ verifyEncryptionData()

comphelper::DocPasswordVerifierResult XclImpDecrypter::verifyEncryptionData ( const css::uno::Sequence< css::beans::NamedValue > &  rEncryptionData)
overridevirtual

◆ verifyPassword()

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 65 of file xistream.cxx.

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

Member Data Documentation

◆ mnError

ErrCode XclImpDecrypter::mnError
private

Definition at line 87 of file xistream.hxx.

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

◆ mnOldPos

sal_uInt64 XclImpDecrypter::mnOldPos
private

Decrypter error code.

Definition at line 88 of file xistream.hxx.

Referenced by Read(), and Update().

◆ mnRecSize

sal_uInt16 XclImpDecrypter::mnRecSize
private

Last known stream position.

Definition at line 89 of file xistream.hxx.

Referenced by Read(), and Update().


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