1
0
forked from Alepha/Alepha

Correct some of the underlying-forwarding parts of stream stacks.

This commit is contained in:
2024-04-03 23:38:13 -04:00
parent 83034c501f
commit cc1fdf725b

View File

@ -32,19 +32,27 @@ namespace Alepha::Hydrogen::IOStreams ::detail:: StackableStreambuf_m
protected:
// EEEW. But to sidestep/circumvent, all this below is necessary.
auto
forwardOverflow( const int ch ) const
forwardOverflow( const int ch )
{
int (std::streambuf::*ov)( int )= &StackableStreambufUnderlyingShim::overflow;
return ( getUnderlying()->*ov )( ch );
}
auto
forwardUnderflow() const
forwardUnderflow()
{
int (std::streambuf::*uf)()= &StackableStreambufUnderlyingShim::underflow;
return (getUnderlying()->*uf)();
}
auto
underlying_sbumpc() const
{
int (std::streambuf::*sbc)()= &StackableStreambufUnderlyingShim::sbumpc;
return (getUnderlying()->*sbc)();
}
auto
underlying_eback() const
{
@ -72,6 +80,28 @@ namespace Alepha::Hydrogen::IOStreams ::detail:: StackableStreambuf_m
void (std::streambuf::*sg)( char *, char *, char * )= &StackableStreambufUnderlyingShim::setg;
return (getUnderlying()->*sg)( b, g, e );
}
auto
underlying_pbase() const
{
char *(std::streambuf::*pb)() const= &StackableStreambufUnderlyingShim::pbase;
return (getUnderlying()->*pb)();
}
auto
underlying_pptr() const
{
char *(std::streambuf::*pp)() const= &StackableStreambufUnderlyingShim::pptr;
return (getUnderlying()->*pp)();
}
auto
underlying_epptr() const
{
char *(std::streambuf::*ep)() const= &StackableStreambufUnderlyingShim::epptr;
return (getUnderlying()->*ep)();
}
};
struct exports::StackableStreambuf
@ -94,7 +124,7 @@ namespace Alepha::Hydrogen::IOStreams ::detail:: StackableStreambuf_m
void unhook( std::istream &is ) const;
protected:
std::ostream &out( std::ostream &&res= std::ostream{nullptr} ) const;
std::ostream &out( std::ostream &&res= std::ostream{ nullptr } ) const;
int overflow( const int ch ) override;