input/InputStream: make IsEOF() and IsAvailable() const

This commit is contained in:
Max Kellermann
2019-05-29 13:31:54 +02:00
parent 40a48cfba0
commit 971450f0d4
22 changed files with 42 additions and 40 deletions

View File

@@ -90,7 +90,7 @@ class CdioParanoiaInputStream final : public InputStream {
}
/* virtual methods from InputStream */
bool IsEOF() noexcept override;
bool IsEOF() const noexcept override;
size_t Read(std::unique_lock<Mutex> &lock,
void *ptr, size_t size) override;
void Seek(std::unique_lock<Mutex> &lock, offset_type offset) override;
@@ -344,7 +344,7 @@ CdioParanoiaInputStream::Read(std::unique_lock<Mutex> &,
}
bool
CdioParanoiaInputStream::IsEOF() noexcept
CdioParanoiaInputStream::IsEOF() const noexcept
{
return lsn_from + lsn_relofs > lsn_to;
}

View File

@@ -48,7 +48,7 @@ public:
}
/* virtual methods from InputStream */
bool IsEOF() noexcept override;
bool IsEOF() const noexcept override;
size_t Read(std::unique_lock<Mutex> &lock,
void *ptr, size_t size) override;
void Seek(std::unique_lock<Mutex> &lock,
@@ -96,7 +96,7 @@ FfmpegInputStream::Read(std::unique_lock<Mutex> &,
}
bool
FfmpegInputStream::IsEOF() noexcept
FfmpegInputStream::IsEOF() const noexcept
{
return io.IsEOF();
}

View File

@@ -44,7 +44,7 @@ public:
/* virtual methods from InputStream */
bool IsEOF() noexcept override {
bool IsEOF() const noexcept override {
return GetOffset() >= GetSize();
}

View File

@@ -52,7 +52,7 @@ public:
/* virtual methods from InputStream */
bool IsEOF() noexcept override {
bool IsEOF() const noexcept override {
return offset >= size;
}