diff options
author | Yury Melnichek <melnichek@gmail.com> | 2011-04-28 21:56:19 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:17:27 +0300 |
commit | 9179f04bfec92ad07c4c70bd232f7dc657718a3e (patch) | |
tree | 971543e0c883ce4069d01ae939931ddc3eaf4051 /coding/byte_stream.hpp | |
parent | 7eef0f61355c66ab3f98735be49a9258bba6f00f (diff) |
Add CountingStream.
Diffstat (limited to 'coding/byte_stream.hpp')
-rw-r--r-- | coding/byte_stream.hpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/coding/byte_stream.hpp b/coding/byte_stream.hpp index cbdec631c3..cd3ab76af4 100644 --- a/coding/byte_stream.hpp +++ b/coding/byte_stream.hpp @@ -57,3 +57,13 @@ private: TStorage & m_Storage; //size_t m_InitialStorageSize; }; + +class CountingSink +{ +public: + CountingSink() : m_Count(0) {} + inline void Write(void const *, size_t size) { m_Count += size; } + inline size_t GetCount() const { return m_Count; } +private: + size_t m_Count; +}; |