20#ifndef INCLUDED_OOX_HELPER_BINARYINPUTSTREAM_HXX
21#define INCLUDED_OOX_HELPER_BINARYINPUTSTREAM_HXX
27#include <com/sun/star/uno/Reference.hxx>
31#include <rtl/string.hxx>
32#include <rtl/textenc.h>
33#include <rtl/ustring.hxx>
37 namespace io {
class XInputStream; }
42class BinaryOutputStream;
74 virtual sal_Int32
readMemory(
void* opMem, sal_Int32 nBytes,
size_t nAtomSize = 1 ) = 0;
83 virtual void skip( sal_Int32 nBytes,
size_t nAtomSize = 1 ) = 0;
88 template<
typename Type >
97 sal_Int16
readInt16() {
return readValue<sal_Int16>(); }
99 sal_uInt16
readuInt16() {
return readValue<sal_uInt16>(); }
101 sal_Int32
readInt32() {
return readValue<sal_Int32>(); }
105 sal_Int64
readInt64() {
return readValue<sal_Int64>(); }
111 unsigned char readuChar() {
return readValue<unsigned char>(); }
124 template<
typename Type >
125 sal_Int32 readArray(
Type* opnArray, sal_Int32 nElemCount );
139 template<
typename Type >
140 sal_Int32 readArray( ::std::vector< Type >& orVector, sal_Int32 nElemCount );
144 OUString readNulUnicodeArray();
152 OString readCharArray( sal_Int32 nChars );
163 OUString readCharArrayUC( sal_Int32 nChars, rtl_TextEncoding eTextEnc );
171 OUString readUnicodeArray( sal_Int32 nChars );
184 OUString readCompressedUnicodeArray( sal_Int32 nChars,
bool bCompressed );
203template<
typename Type >
212template<
typename Type >
218 sal_Int32 nReadSize = getLimitedValue< sal_Int32, sal_Int32 >( nElemCount, 0,
SAL_MAX_INT32 /
sizeof(
Type ) ) *
sizeof(
Type );
225template<
typename Type >
228 orVector.resize(
static_cast< size_t >( nElemCount ) );
229 return orVector.empty() ? 0 :
readArray(orVector.data(), nElemCount);
251 const css::uno::Reference< css::io::XInputStream >& rxInStrm,
258 virtual void close()
override;
262 virtual sal_Int32 readData(
StreamDataSequence& orData, sal_Int32 nBytes,
size_t nAtomSize = 1 )
override;
266 virtual sal_Int32 readMemory(
void* opMem, sal_Int32 nBytes,
size_t nAtomSize = 1 )
override;
270 virtual void skip( sal_Int32 nBytes,
size_t nAtomSize = 1 )
override;
274 css::uno::Reference< css::io::XInputStream >
298 virtual sal_Int32 readData(
StreamDataSequence& orData, sal_Int32 nBytes,
size_t nAtomSize = 1 )
override;
302 virtual sal_Int32 readMemory(
void* opMem, sal_Int32 nBytes,
size_t nAtomSize = 1 )
override;
306 virtual void skip( sal_Int32 nBytes,
size_t nAtomSize = 1 )
override;
311 {
return getLimitedValue< sal_Int32, sal_Int32 >( nBytes, 0, mpData->getLength() - mnPos ); }
342 virtual sal_Int64
size()
const override;
345 virtual sal_Int64
tell()
const override;
349 virtual void seek( sal_Int64
nPos )
override;
352 virtual void close()
override;
362 virtual sal_Int32
readMemory(
void* opMem, sal_Int32 nBytes,
size_t nAtomSize = 1 )
override;
366 virtual void skip( sal_Int32 nBytes,
size_t nAtomSize = 1 )
override;
371 {
return getLimitedValue< sal_Int32, sal_Int64 >( nBytes, 0,
mnSize -
mnRelPos ); }
Interface for binary output stream classes.
Base class for binary stream classes.
bool mbEof
End of stream flag.
Base class for binary input and output streams wrapping a UNO stream, seekable via the com....
static void convertLittleEndianArray(Type *, size_t)
static void convertLittleEndian(Type &)
Base class for binary input and output streams wrapping a StreamDataSequence, which is always seekabl...
std::shared_ptr< BinaryInputStream > BinaryInputStreamRef
css::uno::Sequence< sal_Int8 > StreamDataSequence