Skip to content

Commit 1bf824e

Browse files
committed
Refactor (inputStream): Add 'remaining' member function
New member function remaining() returns number of bytes in stream from current position to the end of the stream.
1 parent a947fe8 commit 1bf824e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

libraries/libim/io/stream.h

+10-3
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,18 @@ namespace libim {
282282
};
283283

284284

285-
/*
286-
Fix typed classes for Stream to represent only input or output stream.
287-
*/
285+
/**
286+
* Specialized classes for Stream to represent only input or output stream.
287+
*/
288+
288289
class InputStream : public virtual Stream
289290
{
291+
public:
292+
inline std::size_t remaining() const
293+
{
294+
return size() - tell();
295+
}
296+
290297
private:
291298
using Stream::flush;
292299
using Stream::write;

0 commit comments

Comments
 (0)