From eb753d99914a0941ad7e2cfa4c8a364723340fc9 Mon Sep 17 00:00:00 2001 From: Björn Steinbrink Date: Wed, 14 Sep 2005 14:52:47 +0000 Subject: Added stream operator for char, short and long reading and writing. --- src/net/messagein.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/net/messagein.cpp') diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp index 6eb56180..ebf1366f 100644 --- a/src/net/messagein.cpp +++ b/src/net/messagein.cpp @@ -151,3 +151,21 @@ MessageIn::readString(int length) return readString; } + +char& operator<<(char &lhs, MessageIn &msg) +{ + lhs = msg.readByte(); + return lhs; +} + +short& operator<<(short &lhs, MessageIn &msg) +{ + lhs = msg.readShort(); + return lhs; +} + +long& operator<<(long &lhs, MessageIn &msg) +{ + lhs = msg.readLong(); + return lhs; +} -- cgit v1.2.3-70-g09d2