summaryrefslogtreecommitdiff
path: root/include/comphelper/seqstream.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-05-19 13:46:40 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-05-19 21:04:48 +0200
commit62531ec1091c7b3f6a3577889a18234790ec716d (patch)
tree72766dd4a58bbf61e2a56adc870d1a73307a9043 /include/comphelper/seqstream.hxx
parent5eb25f6a7ecb215f7bc81116cd930c1dec645e8d (diff)
add ByteWriter to reduce memory copying when writing data
similarly to ByteReader move both of them down to comphelper, since we want to use it from comphelper, and comphelper is "below" unotools in the module dependency graph Change-Id: Ic98fa2268e125fd8e4378fb899ad5f97de721713 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134645 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/comphelper/seqstream.hxx')
-rw-r--r--include/comphelper/seqstream.hxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/comphelper/seqstream.hxx b/include/comphelper/seqstream.hxx
index 6cf22fdb6ebb..c2ba3913432b 100644
--- a/include/comphelper/seqstream.hxx
+++ b/include/comphelper/seqstream.hxx
@@ -24,8 +24,10 @@
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/io/XSeekable.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <cppuhelper/implbase.hxx>
#include <comphelper/comphelperdllapi.h>
+#include <comphelper/bytereader.hxx>
#include <mutex>
namespace comphelper
@@ -37,7 +39,8 @@ namespace comphelper
class COMPHELPER_DLLPUBLIC SequenceInputStream final
- : public ::cppu::WeakImplHelper< css::io::XInputStream, css::io::XSeekable >
+ : public ::cppu::WeakImplHelper< css::io::XInputStream, css::io::XSeekable, css::lang::XUnoTunnel >,
+ public comphelper::ByteReader
{
std::mutex m_aMutex;
css::uno::Sequence<sal_Int8> const m_aData;
@@ -61,6 +64,12 @@ public:
virtual sal_Int64 SAL_CALL getPosition( ) override;
virtual sal_Int64 SAL_CALL getLength( ) override;
+// css::lang::XUnoTunnel
+ virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
+
+// comphelper::ByteReader
+ virtual sal_Int32 readSomeBytes( sal_Int8* pData, sal_Int32 nBytesToRead ) override;
+
private:
sal_Int32 avail();
};