LibreOffice Module comphelper (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
comphelper::MemoryInputStream Class Reference

Base class for wrappers around memory data that want to be exposed as an XInputStream. More...

#include <seqstream.hxx>

Inheritance diagram for comphelper::MemoryInputStream:
[legend]
Collaboration diagram for comphelper::MemoryInputStream:
[legend]

Public Member Functions

 MemoryInputStream (const sal_Int8 *pData, sal_Int32 nDataLength)
 
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 void SAL_CALL seek (sal_Int64 location) override
 
virtual sal_Int64 SAL_CALL getPosition () override
 
virtual sal_Int64 SAL_CALL getLength () override
 
virtual sal_Int32 readSomeBytes (sal_Int8 *pData, sal_Int32 nBytesToRead) override
 

Private Member Functions

sal_Int32 avail ()
 

Private Attributes

std::mutex m_aMutex
 
const sal_Int8m_pMemoryData
 
sal_Int32 m_nMemoryDataLength
 
sal_Int32 m_nPos
 

Detailed Description

Base class for wrappers around memory data that want to be exposed as an XInputStream.

Definition at line 37 of file seqstream.hxx.

Constructor & Destructor Documentation

◆ MemoryInputStream()

comphelper::MemoryInputStream::MemoryInputStream ( const sal_Int8 pData,
sal_Int32  nDataLength 
)

Definition at line 39 of file seqstream.cxx.

References m_nPos, and pData.

Member Function Documentation

◆ avail()

sal_Int32 comphelper::MemoryInputStream::avail ( )
inlineprivate

Definition at line 49 of file seqstream.cxx.

References m_nMemoryDataLength, and m_nPos.

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

◆ available()

sal_Int32 SAL_CALL comphelper::MemoryInputStream::available ( )
overridevirtual

Definition at line 119 of file seqstream.cxx.

References avail(), and m_aMutex.

◆ closeInput()

void SAL_CALL comphelper::MemoryInputStream::closeInput ( )
overridevirtual

Definition at line 127 of file seqstream.cxx.

References m_aMutex, and m_nPos.

◆ getLength()

sal_Int64 SAL_CALL comphelper::MemoryInputStream::getLength ( )
overridevirtual

Definition at line 151 of file seqstream.cxx.

References m_aMutex, and m_nMemoryDataLength.

◆ getPosition()

sal_Int64 SAL_CALL comphelper::MemoryInputStream::getPosition ( )
overridevirtual

Definition at line 145 of file seqstream.cxx.

References m_aMutex, and m_nPos.

◆ readBytes()

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

Definition at line 59 of file seqstream.cxx.

References aData, avail(), m_aMutex, m_nPos, and m_pMemoryData.

◆ readSomeBytes() [1/2]

virtual sal_Int32 SAL_CALL comphelper::MemoryInputStream::readSomeBytes ( css::uno::Sequence< sal_Int8 > &  aData,
sal_Int32  nMaxBytesToRead 
)
overridevirtual

References getLength().

◆ readSomeBytes() [2/2]

sal_Int32 comphelper::MemoryInputStream::readSomeBytes ( sal_Int8 pData,
sal_Int32  nBytesToRead 
)
overridevirtual

Definition at line 78 of file seqstream.cxx.

References avail(), m_aMutex, m_nPos, m_pMemoryData, and pData.

◆ seek()

void SAL_CALL comphelper::MemoryInputStream::seek ( sal_Int64  location)
overridevirtual

Definition at line 137 of file seqstream.cxx.

References m_aMutex, m_nMemoryDataLength, m_nPos, and SAL_MAX_INT32.

◆ skipBytes()

void SAL_CALL comphelper::MemoryInputStream::skipBytes ( sal_Int32  nBytesToSkip)
overridevirtual

Definition at line 103 of file seqstream.cxx.

References avail(), m_aMutex, and m_nPos.

Member Data Documentation

◆ m_aMutex

std::mutex comphelper::MemoryInputStream::m_aMutex
private

◆ m_nMemoryDataLength

sal_Int32 comphelper::MemoryInputStream::m_nMemoryDataLength
private

Definition at line 43 of file seqstream.hxx.

Referenced by avail(), getLength(), and seek().

◆ m_nPos

sal_Int32 comphelper::MemoryInputStream::m_nPos
private

Definition at line 44 of file seqstream.hxx.

Referenced by avail(), closeInput(), getPosition(), readBytes(), readSomeBytes(), seek(), and skipBytes().

◆ m_pMemoryData

const sal_Int8* comphelper::MemoryInputStream::m_pMemoryData
private

Definition at line 42 of file seqstream.hxx.

Referenced by readBytes(), and readSomeBytes().


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