| 13501 | /////////////////////////////////////////////////////////////////////////// |
| 13502 | |
| 13503 | auto makeStream( StringRef const &filename ) -> IStream const* { |
| 13504 | if( filename.empty() ) |
| 13505 | return new Detail::CoutStream(); |
| 13506 | else if( filename[0] == '%' ) { |
| 13507 | if( filename == "%debug" ) |
| 13508 | return new Detail::DebugOutStream(); |
| 13509 | else |
| 13510 | CATCH_ERROR( "Unrecognised stream: '" << filename << "'" ); |
| 13511 | } |
| 13512 | else |
| 13513 | return new Detail::FileStream( filename ); |
| 13514 | } |
| 13515 | |
| 13516 | // This class encapsulates the idea of a pool of ostringstreams that can be reused. |
| 13517 | struct StringStreams { |