LibreOffice Module unotools (master) 1
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
utl::OInputStreamWrapper Class Reference

helper class for wrapping an SvStream into a com.sun.star.io::XInputStream More...

#include <streamwrap.hxx>

Inheritance diagram for utl::OInputStreamWrapper:
[legend]
Collaboration diagram for utl::OInputStreamWrapper:
[legend]

Public Member Functions

 OInputStreamWrapper (SvStream &_rStream)
 
 OInputStreamWrapper (SvStream *pStream, bool bOwner=false)
 
 OInputStreamWrapper (std::unique_ptr< SvStream > pStream)
 
virtual ~OInputStreamWrapper () override
 
virtual sal_Int32 SAL_CALL readBytes (css::uno::Sequence< sal_Int8 > &aData, sal_Int32 nBytesToRead) override
 
virtual sal_Int32 SAL_CALL readSomeBytes (css::uno::Sequence< sal_Int8 > &aData, sal_Int32 nMaxBytesToRead) override
 
virtual void SAL_CALL skipBytes (sal_Int32 nBytesToSkip) override
 
virtual sal_Int32 SAL_CALL available () override
 
virtual void SAL_CALL closeInput () override
 
virtual sal_Int32 readSomeBytes (sal_Int8 *aData, sal_Int32 nMaxBytesToRead) final override
 

Protected Member Functions

 OInputStreamWrapper ()
 
void SetStream (SvStream *_pStream, bool bOwner)
 
void checkConnected () const
 throws a NotConnectedException if the object is not connected anymore More...
 
void checkError () const
 throws an exception according to the error flag of m_pSvStream More...
 

Protected Attributes

std::mutex m_aMutex
 
SvStreamm_pSvStream
 
bool m_bSvStreamOwner: 1
 

Detailed Description

helper class for wrapping an SvStream into a com.sun.star.io::XInputStream

Definition at line 45 of file streamwrap.hxx.

Constructor & Destructor Documentation

◆ OInputStreamWrapper() [1/4]

utl::OInputStreamWrapper::OInputStreamWrapper ( )
inlineprotected

Definition at line 51 of file streamwrap.hxx.

◆ OInputStreamWrapper() [2/4]

utl::OInputStreamWrapper::OInputStreamWrapper ( SvStream _rStream)

Definition at line 35 of file streamwrap.cxx.

◆ OInputStreamWrapper() [3/4]

utl::OInputStreamWrapper::OInputStreamWrapper ( SvStream pStream,
bool  bOwner = false 
)

Definition at line 41 of file streamwrap.cxx.

◆ OInputStreamWrapper() [4/4]

utl::OInputStreamWrapper::OInputStreamWrapper ( std::unique_ptr< SvStream pStream)

Definition at line 47 of file streamwrap.cxx.

◆ ~OInputStreamWrapper()

utl::OInputStreamWrapper::~OInputStreamWrapper ( )
overridevirtual

Definition at line 53 of file streamwrap.cxx.

References m_bSvStreamOwner, and m_pSvStream.

Member Function Documentation

◆ available()

sal_Int32 SAL_CALL utl::OInputStreamWrapper::available ( )
overridevirtual

◆ checkConnected()

void utl::OInputStreamWrapper::checkConnected ( ) const
protected

throws a NotConnectedException if the object is not connected anymore

Definition at line 144 of file streamwrap.cxx.

References m_pSvStream.

Referenced by available(), checkError(), readBytes(), and readSomeBytes().

◆ checkError()

void utl::OInputStreamWrapper::checkError ( ) const
protected

throws an exception according to the error flag of m_pSvStream

Definition at line 150 of file streamwrap.cxx.

References checkConnected(), ERRCODE_NONE, and m_pSvStream.

Referenced by available(), readBytes(), readSomeBytes(), and skipBytes().

◆ closeInput()

void SAL_CALL utl::OInputStreamWrapper::closeInput ( )
overridevirtual

Definition at line 132 of file streamwrap.cxx.

References m_aMutex, m_bSvStreamOwner, and m_pSvStream.

◆ readBytes()

sal_Int32 SAL_CALL utl::OInputStreamWrapper::readBytes ( css::uno::Sequence< sal_Int8 > &  aData,
sal_Int32  nBytesToRead 
)
overridevirtual

◆ readSomeBytes() [1/2]

sal_Int32 SAL_CALL utl::OInputStreamWrapper::readSomeBytes ( css::uno::Sequence< sal_Int8 > &  aData,
sal_Int32  nMaxBytesToRead 
)
overridevirtual

Definition at line 96 of file streamwrap.cxx.

References aData, checkError(), SvStream::eof(), m_pSvStream, and readBytes().

◆ readSomeBytes() [2/2]

sal_Int32 utl::OInputStreamWrapper::readSomeBytes ( sal_Int8 aData,
sal_Int32  nMaxBytesToRead 
)
finaloverridevirtual

◆ SetStream()

void utl::OInputStreamWrapper::SetStream ( SvStream _pStream,
bool  bOwner 
)
inlineprotected

Definition at line 53 of file streamwrap.hxx.

◆ skipBytes()

void SAL_CALL utl::OInputStreamWrapper::skipBytes ( sal_Int32  nBytesToSkip)
overridevirtual

Definition at line 112 of file streamwrap.cxx.

References checkError(), m_aMutex, m_pSvStream, and SvStream::SeekRel().

Member Data Documentation

◆ m_aMutex

std::mutex utl::OInputStreamWrapper::m_aMutex
protected

Definition at line 48 of file streamwrap.hxx.

Referenced by available(), closeInput(), readBytes(), readSomeBytes(), and skipBytes().

◆ m_bSvStreamOwner

bool utl::OInputStreamWrapper::m_bSvStreamOwner
protected

Definition at line 50 of file streamwrap.hxx.

Referenced by closeInput(), and ~OInputStreamWrapper().

◆ m_pSvStream

SvStream* utl::OInputStreamWrapper::m_pSvStream
protected

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