Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
Catch::StringStreams Struct Reference

Public Member Functions

auto add () -> std::size_t
 
void release (std::size_t index)
 

Public Attributes

std::vector< std::unique_ptr< std::ostringstream > > m_streams
 
std::vector< std::size_t > m_unused
 
std::ostringstream m_referenceStream
 

Detailed Description

Definition at line 140 of file catch_stream.cpp.

Member Function Documentation

◆ add()

auto Catch::StringStreams::add ( ) -> std::size_t
inline

Definition at line 145 of file catch_stream.cpp.

145 {
146 if( m_unused.empty() ) {
147 m_streams.push_back( std::unique_ptr<std::ostringstream>( new std::ostringstream ) );
148 return m_streams.size()-1;
149 }
150 else {
151 auto index = m_unused.back();
152 m_unused.pop_back();
153 return index;
154 }
155 }
std::vector< std::size_t > m_unused
std::vector< std::unique_ptr< std::ostringstream > > m_streams

◆ release()

void Catch::StringStreams::release ( std::size_t index)
inline

Definition at line 157 of file catch_stream.cpp.

157 {
158 m_streams[index]->copyfmt( m_referenceStream ); // Restore initial flags and other state
159 m_unused.push_back(index);
160 }
std::ostringstream m_referenceStream

Member Data Documentation

◆ m_referenceStream

std::ostringstream Catch::StringStreams::m_referenceStream

Definition at line 143 of file catch_stream.cpp.

◆ m_streams

std::vector<std::unique_ptr<std::ostringstream> > Catch::StringStreams::m_streams

Definition at line 141 of file catch_stream.cpp.

◆ m_unused

std::vector<std::size_t> Catch::StringStreams::m_unused

Definition at line 142 of file catch_stream.cpp.


The documentation for this struct was generated from the following file: