Fixed alternate stream bugs

This commit is contained in:
Phil Nash
2012-09-26 18:36:58 +01:00
parent 60fb60f5e0
commit c4160e9ef8
5 changed files with 43 additions and 22 deletions

View File

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