diff options
author | Michael Meeks <michael.meeks@novell.com> | 2011-08-26 16:58:07 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@novell.com> | 2011-08-26 17:11:24 +0100 |
commit | d7e0e737c103ebc145cdf4c6afc182dafe0fcd47 (patch) | |
tree | f917a7c21101271d7c86a5131f38d930875f2562 /comphelper/inc/comphelper/storagehelper.hxx | |
parent | a6176612ff1a6a142a68964b2c0834d28125fc45 (diff) |
add a helper class to do path resolution
includes horrible lifecycle stack workaround for free.
Diffstat (limited to 'comphelper/inc/comphelper/storagehelper.hxx')
-rw-r--r-- | comphelper/inc/comphelper/storagehelper.hxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/comphelper/inc/comphelper/storagehelper.hxx b/comphelper/inc/comphelper/storagehelper.hxx index 078bfb81c885..f4f0f81ea805 100644 --- a/comphelper/inc/comphelper/storagehelper.hxx +++ b/comphelper/inc/comphelper/storagehelper.hxx @@ -167,6 +167,26 @@ public: static sal_Bool IsValidZipEntryFileName( const sal_Unicode *pChar, sal_Int32 nLength, sal_Bool bSlashAllowed ); static sal_Bool PathHasSegment( const ::rtl::OUString& aPath, const ::rtl::OUString& aSegment ); + + // Methods to allow easy use of hierachical names inside storages + + // Unfortunately - the impl.s of XStorage like to invalidate all + // their sub streams and storages when you release references, so + // it is necessary to keep references to all storages down the + // path - this is 'beautiful' (TM). So we need this ugly hack: + class LifecycleProxyImpl; + class LifecycleProxy { + public: + LifecycleProxyImpl *pBadness; + LifecycleProxy(); + ~LifecycleProxy(); + }; + static ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > GetStorageAtPath( + const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > &xStorage, + const ::rtl::OUString& aPath, sal_uInt32 nOpenMode, LifecycleProxy &rNastiness ); + static ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > GetStreamAtPath( + const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > &xStorage, + const ::rtl::OUString& aPath, sal_uInt32 nOpenMode, LifecycleProxy &rNastiness ); }; } |