forked from Alepha/Alepha
Make the underlying streambuf private in stacks.
This commit is contained in:
@ -24,19 +24,24 @@ namespace Alepha::Hydrogen::IOStreams ::detail:: StackableStreambuf_m
|
||||
struct exports::StackableStreambuf
|
||||
: virtual public std::streambuf
|
||||
{
|
||||
public:
|
||||
private:
|
||||
std::streambuf *underlying;
|
||||
|
||||
public:
|
||||
~StackableStreambuf() override;
|
||||
|
||||
// Children must be created by `new`.
|
||||
explicit StackableStreambuf( std::ios &host );
|
||||
|
||||
auto out() const { return std::ostream{ underlying }; }
|
||||
|
||||
virtual void writeChar( char ch )= 0;
|
||||
virtual void drain()= 0;
|
||||
|
||||
void unhook( std::ostream &os ) const;
|
||||
void unhook( std::istream &is ) const;
|
||||
|
||||
protected:
|
||||
std::ostream &out( std::ostream &&res= std::ostream{nullptr} ) const;
|
||||
|
||||
int overflow( const int ch ) override;
|
||||
|
||||
// Underflow is not overridden. A read-oriented
|
||||
|
||||
Reference in New Issue
Block a user