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

#include <ucblockbytes.hxx>

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

Public Member Functions

virtual ErrCode ReadAt (sal_uInt64 nPos, void *pBuffer, std::size_t nCount, std::size_t *pRead) const override
 
virtual ErrCode WriteAt (sal_uInt64, const void *, std::size_t, std::size_t *pWritten) override
 
virtual ErrCode Flush () const override
 
virtual ErrCode SetSize (sal_uInt64) override
 
virtual ErrCode Stat (SvLockBytesStat *pStat) const override
 
void SetError (ErrCode nError)
 
ErrCode const & GetError () const
 
css::uno::Reference< css::io::XInputStream > getInputStream ()
 
bool setInputStream (const css::uno::Reference< css::io::XInputStream > &rxInputStream, bool bSetXSeekable=true)
 
void setStream (const css::uno::Reference< css::io::XStream > &rxStream)
 
void terminate ()
 
css::uno::Reference< css::io::XInputStream > getInputStream () const
 
css::uno::Reference< css::io::XOutputStream > getOutputStream () const
 
css::uno::Reference< css::io::XSeekable > getSeekable () const
 
void setDontClose ()
 
void SetStreamValid ()
 
- Public Member Functions inherited from SvLockBytes
 SvLockBytes ()
 
 SvLockBytes (SvStream *pTheStream, bool bTheOwner=false)
 
virtual ~SvLockBytes () override
 
const SvStreamGetStream () const
 
void SetSynchronMode (bool bTheSync=true)
 
bool IsSynchronMode () const
 
virtual ErrCode ReadAt (sal_uInt64 nPos, void *pBuffer, std::size_t nCount, std::size_t *pRead) const
 
virtual ErrCode WriteAt (sal_uInt64 nPos, const void *pBuffer, std::size_t nCount, std::size_t *pWritten)
 
virtual ErrCode Flush () const
 
virtual ErrCode SetSize (sal_uInt64 nSize)
 
virtual ErrCode Stat (SvLockBytesStat *pStat) const
 
- Public Member Functions inherited from SvRefBase
 SvRefBase ()
 
 SvRefBase (const SvRefBase &)
 
SvRefBaseoperator= (const SvRefBase &)
 
void RestoreNoDelete ()
 
void AddNextRef ()
 
void AddFirstRef ()
 
void ReleaseRef ()
 
unsigned int GetRefCount () const
 

Static Public Member Functions

static UcbLockBytesRef CreateLockBytes (const css::uno::Reference< css::ucb::XContent > &xContent, const css::uno::Sequence< css::beans::PropertyValue > &rProps, StreamMode eMode, const css::uno::Reference< css::task::XInteractionHandler > &xInter)
 
static UcbLockBytesRef CreateInputLockBytes (const css::uno::Reference< css::io::XInputStream > &xContent)
 
static UcbLockBytesRef CreateLockBytes (const css::uno::Reference< css::io::XStream > &xContent)
 

Protected Member Functions

virtual ~UcbLockBytes () override
 
- Protected Member Functions inherited from SvLockBytes
void close ()
 
- Protected Member Functions inherited from SvRefBase
virtual ~SvRefBase () COVERITY_NOEXCEPT_FALSE
 

Private Member Functions

 UcbLockBytes ()
 
bool setInputStreamImpl (std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< css::io::XInputStream > &rxInputStream, bool bSetXSeekable=true)
 

Private Attributes

osl::Condition m_aInitialized
 
osl::Condition m_aTerminated
 
std::mutex m_aMutex
 
css::uno::Reference< css::io::XInputStream > m_xInputStream
 
css::uno::Reference< css::io::XOutputStream > m_xOutputStream
 
css::uno::Reference< css::io::XSeekable > m_xSeekable
 
ErrCode m_nError
 
bool m_bTerminated
 
bool m_bDontClose
 
bool m_bStreamValid
 

Detailed Description

Definition at line 62 of file ucblockbytes.hxx.

Constructor & Destructor Documentation

◆ UcbLockBytes()

utl::UcbLockBytes::UcbLockBytes ( )
private

Definition at line 936 of file ucblockbytes.cxx.

References ERRCODE_NONE, m_bTerminated, and SvLockBytes::SetSynchronMode().

Referenced by CreateInputLockBytes().

◆ ~UcbLockBytes()

utl::UcbLockBytes::~UcbLockBytes ( )
overrideprotectedvirtual

Definition at line 945 of file ucblockbytes.cxx.

References m_bDontClose, m_xInputStream, and m_xOutputStream.

Member Function Documentation

◆ CreateInputLockBytes()

UcbLockBytesRef utl::UcbLockBytes::CreateInputLockBytes ( const css::uno::Reference< css::io::XInputStream > &  xContent)
static

Definition at line 1266 of file ucblockbytes.cxx.

References UcbLockBytes().

◆ CreateLockBytes() [1/2]

static UcbLockBytesRef utl::UcbLockBytes::CreateLockBytes ( const css::uno::Reference< css::io::XStream > &  xContent)
static

◆ CreateLockBytes() [2/2]

static UcbLockBytesRef utl::UcbLockBytes::CreateLockBytes ( const css::uno::Reference< css::ucb::XContent > &  xContent,
const css::uno::Sequence< css::beans::PropertyValue > &  rProps,
StreamMode  eMode,
const css::uno::Reference< css::task::XInteractionHandler > &  xInter 
)
static

Referenced by utl::lcl_CreateStream().

◆ Flush()

ErrCode utl::UcbLockBytes::Flush ( void  ) const
overridevirtual

Reimplemented from SvLockBytes.

Definition at line 1180 of file ucblockbytes.cxx.

References ERRCODE_IO_CANTWRITE, ERRCODE_NONE, Exception, and getOutputStream().

◆ GetError()

ErrCode const & utl::UcbLockBytes::GetError ( ) const
inline

Definition at line 102 of file ucblockbytes.hxx.

References m_nError.

Referenced by terminate().

◆ getInputStream() [1/2]

Reference< XInputStream > utl::UcbLockBytes::getInputStream ( )

Definition at line 979 of file ucblockbytes.cxx.

References m_aMutex, m_bDontClose, and m_xInputStream.

Referenced by ReadAt(), and Stat().

◆ getInputStream() [2/2]

css::uno::Reference< css::io::XInputStream > utl::UcbLockBytes::getInputStream ( ) const
inline

Definition at line 113 of file ucblockbytes.hxx.

References m_aMutex, and m_xInputStream.

◆ getOutputStream()

css::uno::Reference< css::io::XOutputStream > utl::UcbLockBytes::getOutputStream ( ) const
inline

Definition at line 119 of file ucblockbytes.hxx.

References m_aMutex, and m_xOutputStream.

Referenced by Flush(), SetSize(), and WriteAt().

◆ getSeekable()

css::uno::Reference< css::io::XSeekable > utl::UcbLockBytes::getSeekable ( ) const
inline

Definition at line 125 of file ucblockbytes.hxx.

References m_aMutex, and m_xSeekable.

Referenced by ReadAt(), Stat(), and WriteAt().

◆ ReadAt()

ErrCode utl::UcbLockBytes::ReadAt ( sal_uInt64  nPos,
void *  pBuffer,
std::size_t  nCount,
std::size_t *  pRead 
) const
overridevirtual

◆ setDontClose()

void utl::UcbLockBytes::setDontClose ( )
inline

Definition at line 131 of file ucblockbytes.hxx.

References m_bDontClose.

◆ SetError()

void utl::UcbLockBytes::SetError ( ErrCode  nError)
inline

Definition at line 99 of file ucblockbytes.hxx.

References m_nError.

Referenced by terminate().

◆ setInputStream()

bool utl::UcbLockBytes::setInputStream ( const css::uno::Reference< css::io::XInputStream > &  rxInputStream,
bool  bSetXSeekable = true 
)

Definition at line 1002 of file ucblockbytes.cxx.

References m_aMutex, and setInputStreamImpl().

◆ setInputStreamImpl()

bool utl::UcbLockBytes::setInputStreamImpl ( std::unique_lock< std::mutex > &  rGuard,
const css::uno::Reference< css::io::XInputStream > &  rxInputStream,
bool  bSetXSeekable = true 
)
private

◆ SetSize()

ErrCode utl::UcbLockBytes::SetSize ( sal_uInt64  nNewSize)
overridevirtual

◆ setStream()

void utl::UcbLockBytes::setStream ( const css::uno::Reference< css::io::XStream > &  rxStream)

Definition at line 986 of file ucblockbytes.cxx.

References m_aMutex, m_xOutputStream, m_xSeekable, and setInputStreamImpl().

◆ SetStreamValid()

void utl::UcbLockBytes::SetStreamValid ( )

Definition at line 1045 of file ucblockbytes.cxx.

References m_aInitialized, m_bStreamValid, and m_xInputStream.

◆ Stat()

ErrCode utl::UcbLockBytes::Stat ( SvLockBytesStat pStat) const
overridevirtual

◆ terminate()

void utl::UcbLockBytes::terminate ( )

◆ WriteAt()

ErrCode utl::UcbLockBytes::WriteAt ( sal_uInt64  nPos,
const void *  pBuffer,
std::size_t  nCount,
std::size_t *  pWritten 
)
overridevirtual

Member Data Documentation

◆ m_aInitialized

osl::Condition utl::UcbLockBytes::m_aInitialized
private

Definition at line 64 of file ucblockbytes.hxx.

Referenced by ReadAt(), setInputStreamImpl(), SetStreamValid(), Stat(), terminate(), and WriteAt().

◆ m_aMutex

std::mutex utl::UcbLockBytes::m_aMutex
private

◆ m_aTerminated

osl::Condition utl::UcbLockBytes::m_aTerminated
private

Definition at line 65 of file ucblockbytes.hxx.

Referenced by terminate().

◆ m_bDontClose

bool utl::UcbLockBytes::m_bDontClose
private

Definition at line 75 of file ucblockbytes.hxx.

Referenced by getInputStream(), setDontClose(), setInputStreamImpl(), and ~UcbLockBytes().

◆ m_bStreamValid

bool utl::UcbLockBytes::m_bStreamValid
private

Definition at line 76 of file ucblockbytes.hxx.

Referenced by setInputStreamImpl(), and SetStreamValid().

◆ m_bTerminated

bool utl::UcbLockBytes::m_bTerminated
private

Definition at line 74 of file ucblockbytes.hxx.

Referenced by ReadAt(), Stat(), and terminate().

◆ m_nError

ErrCode utl::UcbLockBytes::m_nError
private

Definition at line 72 of file ucblockbytes.hxx.

Referenced by GetError(), and SetError().

◆ m_xInputStream

css::uno::Reference< css::io::XInputStream > utl::UcbLockBytes::m_xInputStream
private

◆ m_xOutputStream

css::uno::Reference< css::io::XOutputStream > utl::UcbLockBytes::m_xOutputStream
private

Definition at line 69 of file ucblockbytes.hxx.

Referenced by getOutputStream(), setStream(), and ~UcbLockBytes().

◆ m_xSeekable

css::uno::Reference< css::io::XSeekable > utl::UcbLockBytes::m_xSeekable
private

Definition at line 70 of file ucblockbytes.hxx.

Referenced by getSeekable(), setInputStreamImpl(), and setStream().


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