diff options
author | Max Kellermann <max@duempel.org> | 2016-02-22 13:14:19 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2016-02-22 13:14:19 +0100 |
commit | 09a188bfd9987587112e239a06740ca0ca1c9914 (patch) | |
tree | b1a15c37e5cc90d85de39a5938cbd95e49f741b6 /src/input | |
parent | 10f086854b8280f0ced27673b1105720f28dafa1 (diff) |
input/InputStream: add method Skip()
Diffstat (limited to 'src/input')
-rw-r--r-- | src/input/InputStream.cxx | 7 | ||||
-rw-r--r-- | src/input/InputStream.hxx | 9 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/input/InputStream.cxx b/src/input/InputStream.cxx index bd593bc29..8ea3ef560 100644 --- a/src/input/InputStream.cxx +++ b/src/input/InputStream.cxx @@ -100,6 +100,13 @@ InputStream::LockSeek(offset_type _offset, Error &error) return Seek(_offset, error); } +bool +InputStream::LockSkip(offset_type _offset, Error &error) +{ + const ScopeLock protect(mutex); + return Skip(_offset, error); +} + Tag * InputStream::ReadTag() { diff --git a/src/input/InputStream.hxx b/src/input/InputStream.hxx index 458947eb4..af010e2e1 100644 --- a/src/input/InputStream.hxx +++ b/src/input/InputStream.hxx @@ -295,6 +295,15 @@ public: } /** + * Skip input bytes. + */ + bool Skip(offset_type _offset, Error &error) { + return Seek(GetOffset() + _offset, error); + } + + bool LockSkip(offset_type _offset, Error &error); + + /** * Returns true if the stream has reached end-of-file. * * The caller must lock the mutex. |