diff options
Diffstat (limited to 'include/object/stdbuf.h')
-rw-r--r-- | include/object/stdbuf.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/object/stdbuf.h b/include/object/stdbuf.h index db30621..271c3ea 100644 --- a/include/object/stdbuf.h +++ b/include/object/stdbuf.h @@ -8,12 +8,17 @@ class BufferOutput : public T { private: BufferOutput(const BufferOutput ©); char *buffer; + uint16_t length; public: - BufferOutput(char *target) { buffer = target; } + BufferOutput(char *target) : buffer(target), length(0) {} virtual void put(char c) { *buffer = c; buffer++; + length++; + } + inline uint16_t size() { + return length; } }; |