diff --git a/IOStreams/StackableStreambuf.cc b/IOStreams/StackableStreambuf.cc index 809bbb3..fe91023 100644 --- a/IOStreams/StackableStreambuf.cc +++ b/IOStreams/StackableStreambuf.cc @@ -93,6 +93,12 @@ namespace Alepha::Hydrogen::IOStreams::detail::StackableStreambuf_m } } + std::size_t + exports::stackDepth( std::ios &ios ) + { + return getStack( ios ).size(); + } + std::ostream & impl::operator << ( std::ostream &os, PopStack ) { diff --git a/IOStreams/StackableStreambuf.h b/IOStreams/StackableStreambuf.h index a1eb219..8f4a4cd 100644 --- a/IOStreams/StackableStreambuf.h +++ b/IOStreams/StackableStreambuf.h @@ -21,6 +21,8 @@ namespace Alepha::Hydrogen::IOStreams ::detail:: StackableStreambuf_m template< typename > struct PushStack; struct PopStack{}; + + std::size_t stackDepth( std::ios & ); } struct StackableStreambufUnderlyingShim