From 7a64e86e58bca7456ca9b1ff9b5759af0befa184 Mon Sep 17 00:00:00 2001 From: Nicolas Noble Date: Wed, 7 Aug 2013 17:08:00 -0700 Subject: Adding the rest of the helpers, and simplifying their implementations. --- includes/Handle.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'includes/Handle.h') diff --git a/includes/Handle.h b/includes/Handle.h index 06b1723..fdadef5 100644 --- a/includes/Handle.h +++ b/includes/Handle.h @@ -56,17 +56,28 @@ class Handle { virtual bool isPendingComplete() { return true; } // helpers - ssize_t write(const String & str) { return write(str.to_charp(), str.strlen()); } off_t tell() { return rtell(); } void seek(off_t offset, int whence = SEEK_SET) { rseek(offset, whence); } - // there need to be more of these Future readU8(); Future readU16(); Future readU32(); Future readU64(); + Future readI8(); + Future readI16(); + Future readI32(); + Future readI64(); + Future writeU8 (uint8_t); + Future writeU16(uint16_t); + Future writeU32(uint32_t); + Future writeU64(uint64_t); + Future writeI8 (int8_t); + Future writeI16(int16_t); + Future writeI32(int32_t); + Future writeI64(int64_t); // these need to be changed into Future<>s + ssize_t write(const String & str) { return write(str.to_charp(), str.strlen()); } void writeString(const char * str, ssize_t len) { if (len < 0) len = strlen(str); forceWrite(str, len); } void writeString(const String & str) { forceWrite(str.to_charp(), str.strlen()); } ssize_t forceRead(void * buf, size_t count, Events::BaseEvent * evt = NULL) throw (GeneralException); -- cgit v1.2.3