Delete StreamInterface methods GetPosition, SetPosition and Rewind

Keep methods on subclasses where they are used: FifoBuffer and
MemoryStream. Also FileStream gets to keep SetPosition, because it's
used by a downstream subclass.

Bug: webrtc:6424
Change-Id: If2a00855aba7c2c9dc0909cda7c8a8ef00e0b9af
Reviewed-on: https://webrtc-review.googlesource.com/c/116487
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26237}
This commit is contained in:
Niels Möller
2019-01-14 12:48:53 +01:00
committed by Commit Bot
parent eb0de2284e
commit 1a86b78180
6 changed files with 22 additions and 92 deletions

View File

@ -40,8 +40,6 @@ class StringStream : public StreamInterface {
size_t* written,
int* error) override;
void Close() override;
bool SetPosition(size_t position) override;
bool GetPosition(size_t* position) const override;
private:
std::string& str_;
@ -92,19 +90,6 @@ StreamResult StringStream::Write(const void* data,
void StringStream::Close() {}
bool StringStream::SetPosition(size_t position) {
if (position > str_.size())
return false;
read_pos_ = position;
return true;
}
bool StringStream::GetPosition(size_t* position) const {
if (position)
*position = read_pos_;
return true;
}
} // namespace
template <typename Base>