Skip to content

Commit

Permalink
Refactor (inputStream): Add 'remaining' member function
Browse files Browse the repository at this point in the history
New member function remaining()  returns number of bytes in stream from current position to the end of the stream.
  • Loading branch information
smlu committed Jul 4, 2020
1 parent a947fe8 commit 1bf824e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions libraries/libim/io/stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,18 @@ namespace libim {
};


/*
Fix typed classes for Stream to represent only input or output stream.
*/
/**
* Specialized classes for Stream to represent only input or output stream.
*/

class InputStream : public virtual Stream
{
public:
inline std::size_t remaining() const
{
return size() - tell();
}

private:
using Stream::flush;
using Stream::write;
Expand Down

0 comments on commit 1bf824e

Please sign in to comment.