summaryrefslogtreecommitdiff
path: root/include/tools/stream.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-06-23 14:35:24 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-25 17:19:06 +0200
commit3361e28f944d9f752f0e0df91968559f1ae55f72 (patch)
tree0d0573918a6f82856360b6cc93ca89c0a2c5057f /include/tools/stream.hxx
parent49ecd18fe233a6e60806d023ae06583471cb233c (diff)
make some tools macros into functions
in the process, eliminate the need to explicitly specify the source/destination type at the callsites. Change-Id: Ie556645791a479989fb737933f1dd58e8533cb1c Reviewed-on: https://gerrit.libreoffice.org/39171 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/tools/stream.hxx')
-rw-r--r--include/tools/stream.hxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx
index a6c5adbea898..b8f30625d822 100644
--- a/include/tools/stream.hxx
+++ b/include/tools/stream.hxx
@@ -412,6 +412,19 @@ public:
of v should be unchanged,
*/
virtual bool good() const { return !(eof() || bad()); }
+
+private:
+ template<typename T>
+ void readNumberWithoutSwap(T& rDataDest)
+ { readNumberWithoutSwap_(&rDataDest, sizeof(rDataDest)); }
+
+ void readNumberWithoutSwap_(void * pDataDest, int nDataSize);
+
+ template<typename T>
+ void writeNumberWithoutSwap(T const & rDataSrc)
+ { writeNumberWithoutSwap_(&rDataSrc, sizeof(rDataSrc)); }
+
+ void writeNumberWithoutSwap_(const void * pDataSrc, int nDataSize);
};
inline SvStream& operator<<( SvStream& rStr, SvStrPtr f )