input/InputStream: add method Skip()

This commit is contained in:
Max Kellermann 2016-02-22 13:14:19 +01:00
parent 10f086854b
commit 09a188bfd9
2 changed files with 16 additions and 0 deletions

View File

@ -100,6 +100,13 @@ InputStream::LockSeek(offset_type _offset, Error &error)
return Seek(_offset, error); return Seek(_offset, error);
} }
bool
InputStream::LockSkip(offset_type _offset, Error &error)
{
const ScopeLock protect(mutex);
return Skip(_offset, error);
}
Tag * Tag *
InputStream::ReadTag() InputStream::ReadTag()
{ {

View File

@ -294,6 +294,15 @@ public:
return LockSeek(0, error); return LockSeek(0, error);
} }
/**
* 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. * Returns true if the stream has reached end-of-file.
* *