LibreOffice Module ucb (master) 1
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
tdoc_ucp::StorageElementFactory Class Reference

#include <tdoc_storage.hxx>

Inheritance diagram for tdoc_ucp::StorageElementFactory:
[legend]
Collaboration diagram for tdoc_ucp::StorageElementFactory:
[legend]

Classes

struct  ltstrbool
 

Public Member Functions

 StorageElementFactory (css::uno::Reference< css::uno::XComponentContext > xContext, rtl::Reference< OfficeDocumentsManager > xDocsMgr)
 
virtual ~StorageElementFactory () override
 
css::uno::Reference< css::embed::XStorage > createTemporaryStorage ()
 
css::uno::Reference< css::embed::XStorage > createStorage (const OUString &rUri, StorageAccessMode eMode)
 
css::uno::Reference< css::io::XInputStream > createInputStream (const OUString &rUri, const OUString &rPassword)
 
css::uno::Reference< css::io::XOutputStream > createOutputStream (const OUString &rUri, const OUString &rPassword, bool bTruncate)
 
css::uno::Reference< css::io::XStream > createStream (const OUString &rUri, const OUString &rPassword, bool bTruncate)
 
- Public Member Functions inherited from salhelper::SimpleReferenceObject
 SimpleReferenceObject ()
 
void acquire ()
 
void release ()
 

Private Types

typedef std::map< std::pair< OUString, bool >, Storage *, ltstrboolStorageMap
 

Private Member Functions

void releaseElement (Storage const *pElement)
 
css::uno::Reference< css::embed::XStorage > queryParentStorage (const OUString &rUri, StorageAccessMode eMode)
 
css::uno::Reference< css::embed::XStorage > queryStorage (const css::uno::Reference< css::embed::XStorage > &xParentStorage, const OUString &rUri, StorageAccessMode eMode)
 
css::uno::Reference< css::io::XStream > queryStream (const css::uno::Reference< css::embed::XStorage > &xParentStorage, const OUString &rUri, const OUString &rPassword, StorageAccessMode eMode, bool bTruncate)
 

Private Attributes

StorageMap m_aMap
 
osl::Mutex m_aMutex
 
rtl::Reference< OfficeDocumentsManagerm_xDocsMgr
 
css::uno::Reference< css::uno::XComponentContext > m_xContext
 

Friends

class Storage
 

Additional Inherited Members

- Static Public Member Functions inherited from salhelper::SimpleReferenceObject
static void * operator new (std::size_t nSize)
 
static void * operator new (std::size_t nSize, std::nothrow_t const &rNothrow)
 
static void operator delete (void *pPtr)
 
static void operator delete (void *pPtr, std::nothrow_t const &rNothrow)
 
- Protected Member Functions inherited from salhelper::SimpleReferenceObject
virtual ~SimpleReferenceObject () COVERITY_NOEXCEPT_FALSE
 
- Protected Attributes inherited from salhelper::SimpleReferenceObject
oslInterlockedCount m_nCount
 

Detailed Description

Definition at line 43 of file tdoc_storage.hxx.

Member Typedef Documentation

◆ StorageMap

typedef std::map< std::pair< OUString, bool >, Storage *, ltstrbool > tdoc_ucp::StorageElementFactory::StorageMap
private

Definition at line 152 of file tdoc_storage.hxx.

Constructor & Destructor Documentation

◆ StorageElementFactory()

StorageElementFactory::StorageElementFactory ( css::uno::Reference< css::uno::XComponentContext >  xContext,
rtl::Reference< OfficeDocumentsManager xDocsMgr 
)

Definition at line 44 of file tdoc_storage.cxx.

References m_xContext.

◆ ~StorageElementFactory()

StorageElementFactory::~StorageElementFactory ( )
overridevirtual

Definition at line 53 of file tdoc_storage.cxx.

References m_aMap.

Member Function Documentation

◆ createInputStream()

uno::Reference< io::XInputStream > StorageElementFactory::createInputStream ( const OUString &  rUri,
const OUString &  rPassword 
)
Exceptions
css::embed::InvalidStorageException
css::lang::IllegalArgumentException
css::io::IOException
css::embed::StorageWrappedTargetException
css::packages::WrongPasswordException
css::uno::RuntimeException

Definition at line 228 of file tdoc_storage.cxx.

References m_aMutex, queryParentStorage(), queryStream(), tdoc_ucp::READ, and xStream.

◆ createOutputStream()

uno::Reference< io::XOutputStream > StorageElementFactory::createOutputStream ( const OUString &  rUri,
const OUString &  rPassword,
bool  bTruncate 
)
Exceptions
css::embed::InvalidStorageException
css::lang::IllegalArgumentException
css::io::IOException
css::embed::StorageWrappedTargetException
css::packages::WrongPasswordException
css::uno::RuntimeException

Definition at line 251 of file tdoc_storage.cxx.

References m_aMutex, m_xContext, queryParentStorage(), queryStream(), tdoc_ucp::READ_WRITE_CREATE, and xStream.

◆ createStorage()

uno::Reference< embed::XStorage > StorageElementFactory::createStorage ( const OUString &  rUri,
StorageAccessMode  eMode 
)
Exceptions
css::embed::InvalidStorageException
css::lang::IllegalArgumentException
css::io::IOException
css::embed::StorageWrappedTargetException
css::uno::RuntimeException

Definition at line 82 of file tdoc_storage.cxx.

References eMode, tdoc_ucp::Uri::isDocument(), tdoc_ucp::Uri::isRoot(), m_aMap, m_aMutex, m_xContext, queryParentStorage(), queryStorage(), tdoc_ucp::READ, tdoc_ucp::READ_WRITE_CREATE, tdoc_ucp::READ_WRITE_NOCREATE, and Storage.

Referenced by queryParentStorage().

◆ createStream()

uno::Reference< io::XStream > StorageElementFactory::createStream ( const OUString &  rUri,
const OUString &  rPassword,
bool  bTruncate 
)
Exceptions
css::embed::InvalidStorageException
css::lang::IllegalArgumentException
css::io::IOException
css::embed::StorageWrappedTargetException
css::packages::WrongPasswordException
css::uno::RuntimeException

Definition at line 290 of file tdoc_storage.cxx.

References m_aMutex, m_xContext, m_xDocsMgr, queryParentStorage(), queryStream(), tdoc_ucp::READ_WRITE_CREATE, tdoc_ucp::READ_WRITE_NOCREATE, and xStream.

◆ createTemporaryStorage()

uno::Reference< embed::XStorage > StorageElementFactory::createTemporaryStorage ( )
Exceptions
css::uno::Exception
css::uno::RuntimeException

Definition at line 61 of file tdoc_storage.cxx.

References m_xContext.

Referenced by queryStorage().

◆ queryParentStorage()

uno::Reference< embed::XStorage > StorageElementFactory::queryParentStorage ( const OUString &  rUri,
StorageAccessMode  eMode 
)
private
Exceptions
css::embed::InvalidStorageException
css::lang::IllegalArgumentException
css::io::IOException
css::embed::StorageWrappedTargetException
css::uno::RuntimeException

Definition at line 335 of file tdoc_storage.cxx.

References createStorage(), eMode, tdoc_ucp::Uri::getParentUri(), tdoc_ucp::Uri::isRoot(), and tdoc_ucp::READ_WRITE_CREATE.

Referenced by createInputStream(), createOutputStream(), createStorage(), and createStream().

◆ queryStorage()

uno::Reference< embed::XStorage > StorageElementFactory::queryStorage ( const css::uno::Reference< css::embed::XStorage > &  xParentStorage,
const OUString &  rUri,
StorageAccessMode  eMode 
)
private
Exceptions
css::embed::InvalidStorageException
css::lang::IllegalArgumentException
css::io::IOException
css::embed::StorageWrappedTargetException
css::uno::RuntimeException

Definition at line 354 of file tdoc_storage.cxx.

References createTemporaryStorage(), eMode, cppu::getCaughtException(), tdoc_ucp::Uri::getDecodedName(), tdoc_ucp::Uri::getDocumentId(), m_xDocsMgr, tdoc_ucp::READ, tdoc_ucp::READ_WRITE_CREATE, and tdoc_ucp::READ_WRITE_NOCREATE.

Referenced by createStorage().

◆ queryStream()

uno::Reference< io::XStream > StorageElementFactory::queryStream ( const css::uno::Reference< css::embed::XStorage > &  xParentStorage,
const OUString &  rUri,
const OUString &  rPassword,
StorageAccessMode  eMode,
bool  bTruncate 
)
private
Exceptions
css::embed::InvalidStorageException
css::lang::IllegalArgumentException
css::io::IOException
css::embed::StorageWrappedTargetException
css::packages::WrongPasswordException
css::uno::RuntimeException

Definition at line 490 of file tdoc_storage.cxx.

References eMode, tdoc_ucp::Uri::getDecodedName(), tdoc_ucp::Uri::isDocument(), tdoc_ucp::Uri::isRoot(), m_aMutex, tdoc_ucp::READ, tdoc_ucp::READ_WRITE_CREATE, tdoc_ucp::READ_WRITE_NOCREATE, and xStream.

Referenced by createInputStream(), createOutputStream(), and createStream().

◆ releaseElement()

void StorageElementFactory::releaseElement ( Storage const *  pElement)
private

Definition at line 323 of file tdoc_storage.cxx.

References tdoc_ucp::Storage::m_aContainerIt, m_aMap, and m_aMutex.

Friends And Related Function Documentation

◆ Storage

friend class Storage
friend

Definition at line 97 of file tdoc_storage.hxx.

Referenced by createStorage().

Member Data Documentation

◆ m_aMap

StorageMap tdoc_ucp::StorageElementFactory::m_aMap
private

Definition at line 154 of file tdoc_storage.hxx.

Referenced by createStorage(), releaseElement(), and ~StorageElementFactory().

◆ m_aMutex

osl::Mutex tdoc_ucp::StorageElementFactory::m_aMutex
private

◆ m_xContext

css::uno::Reference< css::uno::XComponentContext > tdoc_ucp::StorageElementFactory::m_xContext
private

◆ m_xDocsMgr

rtl::Reference< OfficeDocumentsManager > tdoc_ucp::StorageElementFactory::m_xDocsMgr
private

Definition at line 156 of file tdoc_storage.hxx.

Referenced by createStream(), and queryStorage().


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