diff options
author | Arne H Juul <arnej@yahoo-inc.com> | 2017-05-05 14:38:10 +0200 |
---|---|---|
committer | Arne H Juul <arnej@yahoo-inc.com> | 2017-05-08 10:38:23 +0200 |
commit | e81817db16aa9ef5470cacb2a760ff78f62532de (patch) | |
tree | 5c70750fe2dd8bc2befbcf00f20ad633549ff867 /fbench/src/util/filereader.h | |
parent | 7c4e89e0a4f39f715933eb0794c078d1b50406f8 (diff) |
super ugly add post mode
* also, fix some logic with byte offsets and -r option
Diffstat (limited to 'fbench/src/util/filereader.h')
-rw-r--r-- | fbench/src/util/filereader.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fbench/src/util/filereader.h b/fbench/src/util/filereader.h index b553c73a262..6b85ad3ba51 100644 --- a/fbench/src/util/filereader.h +++ b/fbench/src/util/filereader.h @@ -21,6 +21,8 @@ private: std::istream *_file; int _bufsize; std::vector<char> _buf; + uint64_t _lastReadPos; + uint64_t _nextReadPos; int _bufused; int _bufpos; @@ -57,7 +59,7 @@ public: { if(_bufpos == _bufused) FillBuffer(); - return (_bufused > _bufpos) ? _buf[_bufpos++] & 0x0ff : -1; + return (_bufused > _bufpos) ? (_buf[_bufpos++] & 0x0ff) : -1; } /** @@ -98,6 +100,8 @@ public: **/ uint64_t GetBufPos() const { return _bufpos; } + uint64_t GetFilePos() const { return _lastReadPos + _bufpos; } + /** * @returns offset of next newline from pos **/ |