LibreOffice Module framework (master) 1
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
framework::StorageHolder Class Referencefinal

TODO document me. More...

#include <storageholder.hxx>

Classes

struct  TStorageInfo
 

Public Types

typedef ::std::vector< css::uno::Reference< css::embed::XStorage > > TStorageList
 TODO. More...
 
typedef ::std::vector< XMLBasedAcceleratorConfiguration * > TStorageListenerList
 
typedef std::unordered_map< OUString, TStorageInfoTPath2StorageInfo
 TODO. More...
 

Public Member Functions

 StorageHolder ()
 TODO. More...
 
 ~StorageHolder ()
 TODO. More...
 
void forgetCachedStorages ()
 TODO. More...
 
void setRootStorage (const css::uno::Reference< css::embed::XStorage > &xRoot)
 TODO. More...
 
css::uno::Reference< css::embed::XStorage > getRootStorage () const
 TODO. More...
 
css::uno::Reference< css::embed::XStorage > openPath (const OUString &sPath, sal_Int32 nOpenMode)
 TODO open or get! More...
 
StorageHolder::TStorageList getAllPathStorages (const OUString &sPath)
 TODO. More...
 
void commitPath (const OUString &sPath)
 TODO. More...
 
void closePath (const OUString &sPath)
 TODO. More...
 
void notifyPath (const OUString &sPath)
 TODO. More...
 
void addStorageListener (XMLBasedAcceleratorConfiguration *pListener, const OUString &sPath)
 TODO. More...
 
void removeStorageListener (XMLBasedAcceleratorConfiguration *pListener, const OUString &sPath)
 TODO. More...
 
OUString getPathOfStorage (const css::uno::Reference< css::embed::XStorage > &xStorage)
 TODO. More...
 
css::uno::Reference< css::embed::XStorage > getParentStorage (const css::uno::Reference< css::embed::XStorage > &xChild)
 TODO. More...
 
css::uno::Reference< css::embed::XStorage > getParentStorage (const OUString &sChildPath)
 TODO. More...
 
StorageHolderoperator= (const StorageHolder &rCopy)
 TODO. More...
 

Static Public Member Functions

static css::uno::Reference< css::embed::XStorage > openSubStorageWithFallback (const css::uno::Reference< css::embed::XStorage > &xBaseStorage, const OUString &sSubStorage, sal_Int32 eOpenMode)
 opens a sub element of the specified base storage. More...
 

Static Private Member Functions

static OUString impl_st_normPath (const OUString &sPath)
 TODO. More...
 
static std::vector< OUString > impl_st_parsePath (std::u16string_view sPath)
 TODO. More...
 

Private Attributes

std::mutex m_mutex
 
css::uno::Reference< css::embed::XStorage > m_xRoot
 TODO. More...
 
TPath2StorageInfo m_lStorages
 TODO. More...
 

Detailed Description

TODO document me.

Definition at line 35 of file storageholder.hxx.

Member Typedef Documentation

◆ TPath2StorageInfo

typedef std::unordered_map< OUString, TStorageInfo > framework::StorageHolder::TPath2StorageInfo

TODO.

Definition at line 60 of file storageholder.hxx.

◆ TStorageList

typedef ::std::vector< css::uno::Reference< css::embed::XStorage > > framework::StorageHolder::TStorageList

TODO.

Definition at line 42 of file storageholder.hxx.

◆ TStorageListenerList

Definition at line 44 of file storageholder.hxx.

Constructor & Destructor Documentation

◆ StorageHolder()

framework::StorageHolder::StorageHolder ( )

TODO.

Definition at line 39 of file storageholder.cxx.

◆ ~StorageHolder()

framework::StorageHolder::~StorageHolder ( )

TODO.

Definition at line 43 of file storageholder.cxx.

Member Function Documentation

◆ addStorageListener()

void framework::StorageHolder::addStorageListener ( XMLBasedAcceleratorConfiguration pListener,
const OUString &  sPath 
)

◆ closePath()

void framework::StorageHolder::closePath ( const OUString &  sPath)

◆ commitPath()

void framework::StorageHolder::commitPath ( const OUString &  sPath)

TODO.

Definition at line 182 of file storageholder.cxx.

References getAllPathStorages(), m_mutex, and m_xRoot.

Referenced by framework::PresetHandler::commitUserChanges().

◆ forgetCachedStorages()

void framework::StorageHolder::forgetCachedStorages ( )

◆ getAllPathStorages()

StorageHolder::TStorageList framework::StorageHolder::getAllPathStorages ( const OUString &  sPath)

◆ getParentStorage() [1/2]

css::uno::Reference< css::embed::XStorage > framework::StorageHolder::getParentStorage ( const css::uno::Reference< css::embed::XStorage > &  xChild)

TODO.

Definition at line 315 of file storageholder.cxx.

References getParentStorage(), and getPathOfStorage().

Referenced by getParentStorage().

◆ getParentStorage() [2/2]

css::uno::Reference< css::embed::XStorage > framework::StorageHolder::getParentStorage ( const OUString &  sChildPath)

◆ getPathOfStorage()

OUString framework::StorageHolder::getPathOfStorage ( const css::uno::Reference< css::embed::XStorage > &  xStorage)

◆ getRootStorage()

css::uno::Reference< css::embed::XStorage > framework::StorageHolder::getRootStorage ( ) const

TODO.

Definition at line 67 of file storageholder.cxx.

References m_mutex, and m_xRoot.

◆ impl_st_normPath()

OUString framework::StorageHolder::impl_st_normPath ( const OUString &  sPath)
staticprivate

◆ impl_st_parsePath()

std::vector< OUString > framework::StorageHolder::impl_st_parsePath ( std::u16string_view  sPath)
staticprivate

TODO.

Definition at line 431 of file storageholder.cxx.

References o3tl::getToken(), i, and PATH_SEPARATOR_UNICODE.

Referenced by closePath(), getAllPathStorages(), getParentStorage(), and openPath().

◆ notifyPath()

void framework::StorageHolder::notifyPath ( const OUString &  sPath)

◆ openPath()

css::uno::Reference< css::embed::XStorage > framework::StorageHolder::openPath ( const OUString &  sPath,
sal_Int32  nOpenMode 
)

◆ openSubStorageWithFallback()

css::uno::Reference< css::embed::XStorage > framework::StorageHolder::openSubStorageWithFallback ( const css::uno::Reference< css::embed::XStorage > &  xBaseStorage,
const OUString &  sSubStorage,
sal_Int32  eOpenMode 
)
static

opens a sub element of the specified base storage.

If eOpenMode contains an ELEMENT_WRITE flag remove it and try it with the rest of eOpenMode flags again.

@descr First this method try to open the requested sub element using the given open mode. If it failed there is second step, which tries to do the same again ... but removing a might existing WRITE flag from the open mode. The user can suppress this fallback handling by setting the parameter bAllowFallback to sal_False.

Parameters
xBaseStoragethe storage, where the sub element should be searched.
sSubElementthe full name of the sub element. e.g. "default.xml"
eOpenModea flag field, which set the open mode for this operation.

Definition at line 371 of file storageholder.cxx.

References eOpenMode, and SAL_INFO.

Referenced by openPath().

◆ operator=()

StorageHolder & framework::StorageHolder::operator= ( const StorageHolder rCopy)

TODO.

Definition at line 363 of file storageholder.cxx.

References m_lStorages, m_mutex, and m_xRoot.

◆ removeStorageListener()

void framework::StorageHolder::removeStorageListener ( XMLBasedAcceleratorConfiguration pListener,
const OUString &  sPath 
)

◆ setRootStorage()

void framework::StorageHolder::setRootStorage ( const css::uno::Reference< css::embed::XStorage > &  xRoot)

TODO.

Definition at line 61 of file storageholder.cxx.

References m_mutex, and m_xRoot.

Referenced by framework::PresetHandler::connectToResource().

Member Data Documentation

◆ m_lStorages

TPath2StorageInfo framework::StorageHolder::m_lStorages
private

◆ m_mutex

std::mutex framework::StorageHolder::m_mutex
mutableprivate

◆ m_xRoot

css::uno::Reference< css::embed::XStorage > framework::StorageHolder::m_xRoot
private

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