summaryrefslogtreecommitdiffstats
path: root/fbench/src/util/filereader.h
diff options
context:
space:
mode:
Diffstat (limited to 'fbench/src/util/filereader.h')
-rw-r--r--fbench/src/util/filereader.h6
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
**/