From 0072a0880c077fc0a21fd57214e6c5bf8497402a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 26 Jan 2015 00:17:21 +0000 Subject: first version that logs in git-svn-id: http://svn.miranda-ng.org/main/trunk@11913 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/WhatsApp/src/WhatsAPI++/ByteArray.h | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'protocols/WhatsApp/src/WhatsAPI++/ByteArray.h') diff --git a/protocols/WhatsApp/src/WhatsAPI++/ByteArray.h b/protocols/WhatsApp/src/WhatsAPI++/ByteArray.h index 57ac503020..5a3f90d221 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/ByteArray.h +++ b/protocols/WhatsApp/src/WhatsAPI++/ByteArray.h @@ -15,24 +15,23 @@ class ByteArrayOutputStream { protected: - std::vector* buf; + std::vector buf; size_t position; public: ByteArrayOutputStream(int size = 32); - std::vector* toByteArray(); - std::vector* getBuffer(); - size_t getPosition(); + virtual ~ByteArrayOutputStream(); + + std::vector& getBuffer(); void setPosition(size_t count); void write(int i); void write(unsigned char* c, size_t length); void write(const std::string& s); - void print(); void setLength(size_t length); - size_t getLength(); - size_t getCapacity(); - virtual ~ByteArrayOutputStream(); + __forceinline size_t getCapacity() const { return buf.capacity(); } + __forceinline size_t getLength() const { return buf.size(); } + __forceinline size_t getPosition() const { return position; } }; class ByteArrayInputStream { @@ -47,7 +46,6 @@ public: ByteArrayInputStream(std::vector* buf); int read(); int read(std::vector& b, size_t off, size_t length); - void print(); virtual ~ByteArrayInputStream(); }; -- cgit v1.2.3