| 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 { |