summaryrefslogtreecommitdiffstats
path: root/dcop/kdatastream.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitce4a32fe52ef09d8f5ff1dd22c001110902b60a2 (patch)
tree5ac38a06f3dde268dc7927dc155896926aaf7012 /dcop/kdatastream.h
downloadtdelibs-ce4a32fe52ef09d8f5ff1dd22c001110902b60a2.tar.gz
tdelibs-ce4a32fe52ef09d8f5ff1dd22c001110902b60a2.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'dcop/kdatastream.h')
-rw-r--r--dcop/kdatastream.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/dcop/kdatastream.h b/dcop/kdatastream.h
new file mode 100644
index 000000000..2d9b65210
--- /dev/null
+++ b/dcop/kdatastream.h
@@ -0,0 +1,56 @@
+#ifndef __kdatastream__h
+#define __kdatastream__h
+
+#include <qdatastream.h>
+
+inline QDataStream & operator << (QDataStream & str, bool b)
+{
+ str << Q_INT8(b);
+ return str;
+}
+
+inline QDataStream & operator >> (QDataStream & str, bool & b)
+{
+ Q_INT8 l;
+ str >> l;
+ b = bool(l);
+ return str;
+}
+
+#if QT_VERSION < 0x030200 && !defined(Q_WS_WIN) && !defined(Q_WS_MAC)
+inline QDataStream & operator << (QDataStream & str, long long int ll)
+{
+ Q_UINT32 l1,l2;
+ l1 = ll & 0xffffffffLL;
+ l2 = ll >> 32;
+ str << l1 << l2;
+ return str;
+}
+
+inline QDataStream & operator >> (QDataStream & str, long long int&ll)
+{
+ Q_UINT32 l1,l2;
+ str >> l1 >> l2;
+ ll = ((unsigned long long int)(l2) << 32) + (long long int) l1;
+ return str;
+}
+
+inline QDataStream & operator << (QDataStream & str, unsigned long long int ll)
+{
+ Q_UINT32 l1,l2;
+ l1 = ll & 0xffffffffLL;
+ l2 = ll >> 32;
+ str << l1 << l2;
+ return str;
+}
+
+inline QDataStream & operator >> (QDataStream & str, unsigned long long int &ll)
+{
+ Q_UINT32 l1,l2;
+ str >> l1 >> l2;
+ ll = ((unsigned long long int)(l2) << 32) + (unsigned long long int) l1;
+ return str;
+}
+#endif
+
+#endif