diff options
author | Ariel Constenla-Haile <arielch@apache.org> | 2013-06-01 17:16:49 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-06-04 11:09:20 +0100 |
commit | 8de6167e36506a5cba21f6a35d4f064e9c9ea368 (patch) | |
tree | 33cf12274da8ff1f4bfeda2ea7c5d456bf4d34b9 /include/ucbhelper | |
parent | 39e21050fe9e47b0496b0f4cc9e85f6577f0f6ce (diff) |
Resolves: #i122273# - Avoid using tmpfile()
(cherry picked from commit c4ef17d5e2844ca8d2459a3bfa1f91d99ac297f2)
Conflicts:
ucb/source/ucp/ftp/ftpcfunc.cxx
ucb/source/ucp/ftp/ftpinpstr.cxx
ucb/source/ucp/ftp/ftpinpstr.hxx
ucb/source/ucp/ftp/ftpurl.cxx
Change-Id: I267a9191f9b922380bef8653ac74543662ebf3ef
Diffstat (limited to 'include/ucbhelper')
-rw-r--r-- | include/ucbhelper/fd_inputstream.hxx | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/include/ucbhelper/fd_inputstream.hxx b/include/ucbhelper/fd_inputstream.hxx index df3d6e386b67..6246af048780 100644 --- a/include/ucbhelper/fd_inputstream.hxx +++ b/include/ucbhelper/fd_inputstream.hxx @@ -22,23 +22,26 @@ #include <rtl/ustring.hxx> #include <osl/mutex.hxx> -#include <cppuhelper/weak.hxx> -#include <cppuhelper/queryinterface.hxx> +#include <osl/file.h> #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/XSeekable.hpp> -#include <stdio.h> +#include <cppuhelper/implbase2.hxx> +#include <cppuhelper/basemutex.hxx> #include "ucbhelper/ucbhelperdllapi.h" namespace ucbhelper { + typedef ::cppu::WeakImplHelper2< + com::sun::star::io::XInputStream, + com::sun::star::io::XSeekable > FdInputStream_Base; + /** Implements a seekable InputStream * working on a buffer. */ class UCBHELPER_DLLPUBLIC FdInputStream - : public cppu::OWeakObject, - public com::sun::star::io::XInputStream, - public com::sun::star::io::XSeekable + : protected cppu::BaseMutex, + public FdInputStream_Base { public: @@ -46,16 +49,9 @@ namespace ucbhelper * on which the inputstream acts. */ - FdInputStream(FILE* tmpfl = 0); - - ~FdInputStream(); - - virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& rType) - throw(css::uno::RuntimeException); + FdInputStream(oslFileHandle tmpfl = 0); - virtual void SAL_CALL acquire(void) throw(); - - virtual void SAL_CALL release(void) throw(); + virtual ~FdInputStream(); virtual sal_Int32 SAL_CALL readBytes(css::uno::Sequence< sal_Int8 >& aData, @@ -114,14 +110,9 @@ namespace ucbhelper throw(css::io::IOException, css::uno::RuntimeException); - // additional -// void append(const void* pBuffer,size_t size,size_t nmemb); - private: - - osl::Mutex m_aMutex; - FILE* m_tmpfl; - sal_Int64 m_nLength; + oslFileHandle m_tmpfl; + sal_uInt64 m_nLength; }; } |