aboutsummaryrefslogtreecommitdiffstats
path: root/common/rdr/BufferedInStream.h
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2022-08-23 17:09:40 +0200
committerPierre Ossman <ossman@cendio.se>2022-08-25 11:06:33 +0200
commit0ae1557ed9a7f8b46b6d7e2feaf2fad4cc2c3b3d (patch)
treebc0fdcf38944b9aba09198f5e7d0967ab056ef8e /common/rdr/BufferedInStream.h
parent62965aa1cd7cd126c7ed505f07430a7194cb3e0f (diff)
downloadtigervnc-0ae1557ed9a7f8b46b6d7e2feaf2fad4cc2c3b3d.tar.gz
tigervnc-0ae1557ed9a7f8b46b6d7e2feaf2fad4cc2c3b3d.zip
Make BufferedInStream allocation more available
Allow subclasses to call it, instead of it being strictly internal. This is useful when a subclass can only provide data in minimum sized chunks.
Diffstat (limited to 'common/rdr/BufferedInStream.h')
-rw-r--r--common/rdr/BufferedInStream.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/common/rdr/BufferedInStream.h b/common/rdr/BufferedInStream.h
index 84405255..05f7231e 100644
--- a/common/rdr/BufferedInStream.h
+++ b/common/rdr/BufferedInStream.h
@@ -37,8 +37,13 @@ namespace rdr {
virtual size_t pos();
+ protected:
+ size_t availSpace() { return start + bufSize - end; }
+
+ void ensureSpace(size_t needed);
+
private:
- virtual bool fillBuffer(size_t maxSize) = 0;
+ virtual bool fillBuffer() = 0;
virtual bool overrun(size_t needed);