LibreOffice Module vcl (master) 1
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
BinaryDataContainer Class Referencefinal

Container for the binary data, whose responsibility is to manage the make it as simple as possible to manage the binary data. More...

#include <BinaryDataContainer.hxx>

Classes

struct  Impl
 

Public Member Functions

 BinaryDataContainer ()=default
 
 BinaryDataContainer (SvStream &stream, size_t size)
 
 BinaryDataContainer (const BinaryDataContainer &rBinaryDataContainer)=default
 
 BinaryDataContainer (BinaryDataContainer &&rBinaryDataContainer) noexcept=default
 
BinaryDataContaineroperator= (const BinaryDataContainer &rBinaryDataContainer)=default
 
BinaryDataContaineroperator= (BinaryDataContainer &&rBinaryDataContainer) noexcept=default
 
size_t getSize () const
 
bool isEmpty () const
 
const sal_uInt8getData () const
 
css::uno::Sequence< sal_Int8getCopyAsByteSequence () const
 
std::shared_ptr< SvStreamgetAsStream ()
 
css::uno::Reference< css::io::XInputStream > getAsXInputStream ()
 
std::size_t writeToStream (SvStream &rStream) const
 writes the contents to the given stream More...
 
std::size_t getSizeBytes () const
 return the in-memory size in bytes as of now. More...
 
void swapOut () const
 swap out to disk for now More...
 
size_t calculateHash () const
 

Private Member Functions

void ensureSwappedIn () const
 

Private Attributes

std::shared_ptr< ImplmpImpl
 

Detailed Description

Container for the binary data, whose responsibility is to manage the make it as simple as possible to manage the binary data.

The binary data can be anything, but typically it is a in-memory data from files (i.e. files of graphic formats).

Definition at line 29 of file BinaryDataContainer.hxx.

Constructor & Destructor Documentation

◆ BinaryDataContainer() [1/4]

BinaryDataContainer::BinaryDataContainer ( )
default

◆ BinaryDataContainer() [2/4]

BinaryDataContainer::BinaryDataContainer ( SvStream stream,
size_t  size 
)

Definition at line 72 of file BinaryDataContainer.cxx.

References size, and stream.

◆ BinaryDataContainer() [3/4]

BinaryDataContainer::BinaryDataContainer ( const BinaryDataContainer rBinaryDataContainer)
default

◆ BinaryDataContainer() [4/4]

BinaryDataContainer::BinaryDataContainer ( BinaryDataContainer &&  rBinaryDataContainer)
defaultnoexcept

Member Function Documentation

◆ calculateHash()

size_t BinaryDataContainer::calculateHash ( ) const

Definition at line 77 of file BinaryDataContainer.cxx.

References getSize(), o3tl::hash_combine(), and mpImpl.

Referenced by GfxLink::GetHash().

◆ ensureSwappedIn()

void BinaryDataContainer::ensureSwappedIn ( ) const
private

Definition at line 175 of file BinaryDataContainer.cxx.

References mpImpl.

Referenced by getAsStream(), getAsXInputStream(), getData(), getSize(), isEmpty(), and writeToStream().

◆ getAsStream()

std::shared_ptr< SvStream > BinaryDataContainer::getAsStream ( )

◆ getAsXInputStream()

css::uno::Reference< css::io::XInputStream > BinaryDataContainer::getAsXInputStream ( )

Definition at line 140 of file BinaryDataContainer.cxx.

References ensureSwappedIn(), and mpImpl.

Referenced by VectorGraphicData::ensureSequenceAndRange().

◆ getCopyAsByteSequence()

css::uno::Sequence< sal_Int8 > BinaryDataContainer::getCopyAsByteSequence ( ) const

Definition at line 89 of file BinaryDataContainer.cxx.

References aData, getSize(), isEmpty(), and mpImpl.

Referenced by UnoBinaryDataContainer::getCopyAsByteSequence().

◆ getData()

const sal_uInt8 * BinaryDataContainer::getData ( ) const

◆ getSize()

size_t BinaryDataContainer::getSize ( ) const

◆ getSizeBytes()

size_t BinaryDataContainer::getSizeBytes ( ) const

return the in-memory size in bytes as of now.

Definition at line 158 of file BinaryDataContainer.cxx.

References mpImpl.

Referenced by GfxLink::getSizeBytes().

◆ isEmpty()

bool BinaryDataContainer::isEmpty ( ) const

◆ operator=() [1/2]

BinaryDataContainer & BinaryDataContainer::operator= ( BinaryDataContainer &&  rBinaryDataContainer)
defaultnoexcept

◆ operator=() [2/2]

BinaryDataContainer & BinaryDataContainer::operator= ( const BinaryDataContainer rBinaryDataContainer)
default

◆ swapOut()

void BinaryDataContainer::swapOut ( ) const

swap out to disk for now

Definition at line 181 of file BinaryDataContainer.cxx.

References comphelper::LibreOfficeKit::isActive(), and mpImpl.

◆ writeToStream()

std::size_t BinaryDataContainer::writeToStream ( SvStream rStream) const

writes the contents to the given stream

Definition at line 146 of file BinaryDataContainer.cxx.

References ensureSwappedIn(), getData(), getSize(), and SvStream::WriteBytes().

Member Data Documentation

◆ mpImpl

std::shared_ptr<Impl> BinaryDataContainer::mpImpl
private

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