| 13727 | /////////////////////////////////////////////////////////////////////////// |
| 13728 | |
| 13729 | auto makeStream( StringRef const &filename ) -> IStream const* { |
| 13730 | if( filename.empty() ) |
| 13731 | return new Detail::CoutStream(); |
| 13732 | else if( filename[0] == '%' ) { |
| 13733 | if( filename == "%debug" ) |
| 13734 | return new Detail::DebugOutStream(); |
| 13735 | else |
| 13736 | CATCH_ERROR( "Unrecognised stream: '" << filename << "'" ); |
| 13737 | } |
| 13738 | else |
| 13739 | return new Detail::FileStream( filename ); |
| 13740 | } |
| 13741 | |
| 13742 | // This class encapsulates the idea of a pool of ostringstreams that can be reused. |
| 13743 | struct StringStreams { |