summaryrefslogtreecommitdiffstats
path: root/hwpfilter/source/hiodev.h
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-02-25 10:50:59 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-02-25 17:05:31 +0000
commitf974db5d89eacf0c23e303c22c62972014e9db16 (patch)
treeda33b75213c805b8f57ecab8d7e7a04786253807 /hwpfilter/source/hiodev.h
parentsw: convert import & export components to constructor usage (diff)
downloadcore-f974db5d89eacf0c23e303c22c62972014e9db16.tar.gz
core-f974db5d89eacf0c23e303c22c62972014e9db16.zip
check if reads were successful
Change-Id: I69ab0ca9c017c9a1c10d18fd850f32a92c641d12 Reviewed-on: https://gerrit.libreoffice.org/14631 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'hwpfilter/source/hiodev.h')
-rw-r--r--hwpfilter/source/hiodev.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/hwpfilter/source/hiodev.h b/hwpfilter/source/hiodev.h
index def45bbed51c..967be2081cfc 100644
--- a/hwpfilter/source/hiodev.h
+++ b/hwpfilter/source/hiodev.h
@@ -52,9 +52,11 @@ class DLLEXPORT HIODev
/* gzip routine wrapper */
virtual bool setCompressed( bool ) = 0;
- virtual int read1b() = 0;
- virtual int read2b() = 0;
- virtual int read4b() = 0;
+ virtual bool read1b(unsigned char &out) = 0;
+ virtual bool read1b(char &out) = 0;
+ virtual bool read2b(unsigned short &out) = 0;
+ virtual bool read4b(unsigned int &out) = 0;
+ virtual bool read4b(int &out) = 0;
virtual int readBlock( void *ptr, int size ) = 0;
virtual int skipBlock( int size ) = 0;
@@ -104,17 +106,19 @@ class HStreamIODev : public HIODev
* Read one byte from stream
*/
using HIODev::read1b;
- virtual int read1b() SAL_OVERRIDE;
+ virtual bool read1b(unsigned char &out) SAL_OVERRIDE;
+ virtual bool read1b(char &out) SAL_OVERRIDE;
/**
* Read 2 bytes from stream
*/
using HIODev::read2b;
- virtual int read2b() SAL_OVERRIDE;
+ virtual bool read2b(unsigned short &out) SAL_OVERRIDE;
/**
* Read 4 bytes from stream
*/
using HIODev::read4b;
- virtual int read4b() SAL_OVERRIDE;
+ virtual bool read4b(unsigned int &out) SAL_OVERRIDE;
+ virtual bool read4b(int &out) SAL_OVERRIDE;
/**
* Read some bytes from stream to given pointer as amount of size
*/
@@ -150,11 +154,13 @@ class HMemIODev : public HIODev
/* gzip routine wrapper */
virtual bool setCompressed( bool ) SAL_OVERRIDE;
using HIODev::read1b;
- virtual int read1b() SAL_OVERRIDE;
+ virtual bool read1b(unsigned char &out) SAL_OVERRIDE;
+ virtual bool read1b(char &out) SAL_OVERRIDE;
using HIODev::read2b;
- virtual int read2b() SAL_OVERRIDE;
+ virtual bool read2b(unsigned short &out) SAL_OVERRIDE;
using HIODev::read4b;
- virtual int read4b() SAL_OVERRIDE;
+ virtual bool read4b(unsigned int &out) SAL_OVERRIDE;
+ virtual bool read4b(int &out) SAL_OVERRIDE;
virtual int readBlock( void *ptr, int size ) SAL_OVERRIDE;
virtual int skipBlock( int size ) SAL_OVERRIDE;
protected: