mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-20 11:35:39 +02:00
Fixed alternate stream bugs
This commit is contained in:
@@ -58,6 +58,30 @@ namespace Catch {
|
||||
writeToDebugConsole( str );
|
||||
}
|
||||
};
|
||||
|
||||
class Stream {
|
||||
public:
|
||||
Stream()
|
||||
: streamBuf( NULL ), isOwned( false )
|
||||
{}
|
||||
|
||||
Stream( std::streambuf* _streamBuf, bool _isOwned )
|
||||
: streamBuf( _streamBuf ), isOwned( _isOwned )
|
||||
{}
|
||||
|
||||
void release() {
|
||||
if( isOwned ) {
|
||||
delete streamBuf;
|
||||
streamBuf = NULL;
|
||||
isOwned = false;
|
||||
}
|
||||
}
|
||||
|
||||
std::streambuf* streamBuf;
|
||||
|
||||
private:
|
||||
bool isOwned;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // TWOBLUECUBES_CATCH_STREAM_HPP_INCLUDED
|
||||
|
Reference in New Issue
Block a user