summaryrefslogtreecommitdiff
path: root/include/comphelper
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-09-29 16:31:24 +0200
committerMatúš Kukan <matus.kukan@collabora.com>2014-10-23 11:53:19 +0200
commitd45607c4be485952158c58b1ebb83f7632f1a057 (patch)
tree8a04c9167452f7a12520b5534b0f58390ff660b0 /include/comphelper
parentea052e766a67c2ae74d0960782c4d5fb335c25e6 (diff)
Revert recent changes to comphelper::OSequenceOutputStream
Some of the changes could be wrong and we don't need them. This reverts commit 784d4bea86d8cbb3a855e557c465ce50a049cefc. This reverts commit 8524d5aba59148eef94859289f00ab6477e0e821. This reverts commit 018f1deae884febbbe639c7ee46b45ce4807e9d3. This reverts commit 8124fddc5803b4e104d4fc2456cb92cb030d9436. We use our own helper cache class in FastSaxSerializer since f736eba5a9df8645849a37b08d2764a5f495ab45. Change-Id: Iaca6b5b11cb32595db4420a02fa72b0007cf6286
Diffstat (limited to 'include/comphelper')
-rw-r--r--include/comphelper/seqstream.hxx32
1 files changed, 15 insertions, 17 deletions
diff --git a/include/comphelper/seqstream.hxx b/include/comphelper/seqstream.hxx
index 1288a9baea73..d5729955000c 100644
--- a/include/comphelper/seqstream.hxx
+++ b/include/comphelper/seqstream.hxx
@@ -74,21 +74,26 @@ public:
private:
inline sal_Int32 avail();
};
+typedef ::cppu::WeakImplHelper1< ::com::sun::star::io::XOutputStream > OSequenceOutputStream_Base;
-class COMPHELPER_DLLPUBLIC OSequenceOutputStream :
- public ::cppu::WeakImplHelper1< ::com::sun::star::io::XOutputStream >
+class OSequenceOutputStream : public OSequenceOutputStream_Base
{
protected:
::com::sun::star::uno::Sequence< sal_Int8 >& m_rSequence;
double m_nResizeFactor;
sal_Int32 m_nMinimumResize;
sal_Int32 m_nMaximumResize;
- /** the size of the virtual stream. This is not the size of the sequence,
- but the number of bytes written into the stream at a given moment.
- */
sal_Int32 m_nSize;
+ // the size of the virtual stream. This is not the size of the sequence, but the number of bytes written
+ // into the stream at a given moment.
- bool m_bConnected; ///< closeOutput has been called ?
+ bool m_bConnected;
+ // closeOutput has been called ?
+
+ ::osl::Mutex m_aMutex;
+
+protected:
+ virtual ~OSequenceOutputStream() { if (m_bConnected) closeOutput(); }
public:
/** constructs the object. Everything written into the stream through the XOutputStream methods will be forwarded
@@ -113,20 +118,13 @@ public:
sal_Int32 _nMaximumResize = -1
);
- virtual ~OSequenceOutputStream() { if (m_bConnected) closeOutput(); }
-
- sal_Int32 getSize() const { return m_nSize; }
-
/// same as XOutputStream::writeBytes (as expected :)
virtual void SAL_CALL writeBytes( const ::com::sun::star::uno::Sequence< sal_Int8 >& aData ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
- void SAL_CALL writeBytes( const sal_Int8* pStr, sal_Int32 nLen )
- throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException, std::exception);
- /** Resizes the sequence used for writing to the really used size.
- * Next time, writeBytes will write to the beginning of the sequence.
- */
+ /// this is a dummy in this implementation, no buffering is used
virtual void SAL_CALL flush( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
- /** Calls flush() and closes the output stream to prevent further manipulation with the sequence.
- Every subsequent call to one of the XOutputStream methods will throw a <code>NotConnectedException</code>.
+ /** closes the output stream. In the case of this class, this means that the sequence used for writing is
+ resized to the really used size and not used any further, every subsequent call to one of the XOutputStream
+ methods will throw a <code>NotConnectedException</code>.
*/
virtual void SAL_CALL closeOutput( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
};