MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / makeStream

Function makeStream

unittests/catch.hpp:9481–9492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9479 ///////////////////////////////////////////////////////////////////////////
9480
9481 auto makeStream( StringRef const &filename ) -> IStream const* {
9482 if( filename.empty() )
9483 return new detail::CoutStream();
9484 else if( filename[0] == '%' ) {
9485 if( filename == "%debug" )
9486 return new detail::DebugOutStream();
9487 else
9488 CATCH_ERROR( "Unrecognised stream: '" << filename << "'" );
9489 }
9490 else
9491 return new detail::FileStream( filename );
9492 }
9493
9494 // This class encapsulates the idea of a pool of ostringstreams that can be reused.
9495 struct StringStreams {

Callers 1

openStreamMethod · 0.85

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected