forked from catchorg/Catch2
Store IStream instance owning ptrs in reporter instances
This ended up being a surprisingly large refactoring, motivated by removing a `const_cast` from `Config`'s handling of reporter streams, forced by previous commit.
This commit is contained in:
@@ -17,21 +17,25 @@
|
||||
#include <catch2/internal/catch_move_and_forward.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <iomanip>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
ReporterConfig::ReporterConfig(
|
||||
IConfig const* _fullConfig,
|
||||
IStream* _stream,
|
||||
Detail::unique_ptr<IStream> _stream,
|
||||
ColourMode colourMode,
|
||||
std::map<std::string, std::string> customOptions ):
|
||||
m_stream( _stream ),
|
||||
m_stream( CATCH_MOVE(_stream) ),
|
||||
m_fullConfig( _fullConfig ),
|
||||
m_colourMode( colourMode ),
|
||||
m_customOptions( CATCH_MOVE( customOptions ) ) {}
|
||||
|
||||
IStream* ReporterConfig::stream() const { return m_stream; }
|
||||
Detail::unique_ptr<IStream> ReporterConfig::takeStream() && {
|
||||
assert( m_stream );
|
||||
return CATCH_MOVE( m_stream );
|
||||
}
|
||||
IConfig const * ReporterConfig::fullConfig() const { return m_fullConfig; }
|
||||
ColourMode ReporterConfig::colourMode() const { return m_colourMode; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user