| 11034 | /////////////////////////////////////////////////////////////////////////// |
| 11035 | |
| 11036 | auto makeStream( StringRef const &filename ) -> IStream const* { |
| 11037 | if( filename.empty() ) |
| 11038 | return new detail::CoutStream(); |
| 11039 | else if( filename[0] == '%' ) { |
| 11040 | if( filename == "%debug" ) |
| 11041 | return new detail::DebugOutStream(); |
| 11042 | else |
| 11043 | CATCH_ERROR( "Unrecognised stream: '" << filename << "'" ); |
| 11044 | } |
| 11045 | else |
| 11046 | return new detail::FileStream( filename ); |
| 11047 | } |
| 11048 | |
| 11049 | // This class encapsulates the idea of a pool of ostringstreams that can be reused. |
| 11050 | struct StringStreams { |