20#ifndef INCLUDED_OOX_HELPER_STORAGEBASE_HXX
21#define INCLUDED_OOX_HELPER_STORAGEBASE_HXX
27#include <com/sun/star/uno/Reference.hxx>
30#include <rtl/ustring.hxx>
33 namespace embed {
class XStorage; }
34 namespace io {
class XInputStream; }
35 namespace io {
class XOutputStream; }
36 namespace io {
class XStream; }
55 const css::uno::Reference< css::io::XInputStream >& rxInStream,
56 bool bBaseStreamAccess );
59 const css::uno::Reference< css::io::XStream >& rxOutStream,
60 bool bBaseStreamAccess );
65 bool isStorage()
const;
68 bool isRootStorage()
const;
75 css::uno::Reference< css::embed::XStorage >
79 const OUString&
getName()
const {
return maStorageName;}
82 OUString getPath()
const;
86 void getElementNames( ::std::vector< OUString >& orElementNames )
const;
97 StorageRef openSubStorage(
const OUString& rStorageName,
bool bCreateMissing );
107 css::uno::Reference< css::io::XInputStream >
108 openInputStream(
const OUString& rStreamName );
118 css::uno::Reference< css::io::XOutputStream >
119 openOutputStream(
const OUString& rStreamName );
130 void copyToStorage(
StorageBase& rDestStrg,
const OUString& rElementName );
134 void copyStorageToStorage(
StorageBase& rDestStrg );
151 virtual css::uno::Reference< css::embed::XStorage >
161 virtual css::uno::Reference< css::io::XInputStream >
165 virtual css::uno::Reference< css::io::XOutputStream >
172 StorageRef getSubStorage(
const OUString& rElementName,
bool bCreateMissing );
177 css::uno::Reference< css::io::XInputStream >
179 css::uno::Reference< css::io::XStream >
Template for a map of ref-counted objects with additional accessor functions.
Base class for storage access implementations.
virtual css::uno::Reference< css::embed::XStorage > implGetXStorage() const =0
Returns the com.sun.star.embed.XStorage interface of the current storage.
virtual bool implIsStorage() const =0
Returns true, if the object represents a valid storage.
StorageBase(const css::uno::Reference< css::io::XInputStream > &rxInStream, bool bBaseStreamAccess)
const OUString & getName() const
Returns the element name of this storage.
StorageBase(const StorageBase &)=delete
bool mbReadOnly
True = storage opened read-only (based on input stream).
css::uno::Reference< css::io::XStream > mxOutStream
Cached base output stream (to keep it alive).
css::uno::Reference< css::io::XInputStream > mxInStream
Cached base input stream (to keep it alive).
bool mbBaseStreamAccess
True = access base streams with empty stream name.
StorageBase & operator=(const StorageBase &)=delete
OUString maStorageName
Name of this storage, if it is a substorage.
virtual void implCommit() const =0
Commits the current storage.
RefMap< OUString, StorageBase > maSubStorages
Map of direct sub storages.
virtual css::uno::Reference< css::io::XInputStream > implOpenInputStream(const OUString &rElementName)=0
Implementation of opening an input stream element.
virtual css::uno::Reference< css::io::XOutputStream > implOpenOutputStream(const OUString &rElementName)=0
Implementation of opening an output stream element.
StorageBase(const css::uno::Reference< css::io::XStream > &rxOutStream, bool bBaseStreamAccess)
bool isReadOnly() const
Returns true, if the storage operates in read-only mode (based on an input stream).
virtual StorageRef implOpenSubStorage(const OUString &rElementName, bool bCreate)=0
Implementation of opening a storage element.
virtual void implGetElementNames(::std::vector< OUString > &orElementNames) const =0
Returns the names of all elements of this storage.
OUString maParentPath
Full path of parent storage.
std::shared_ptr< StorageBase > StorageRef