Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
flutter::testing::StreamCapture Class Reference

#include <stream_capture.h>

Public Member Functions

 StreamCapture (std::ostream *ostream)
 
 ~StreamCapture ()
 
void Stop ()
 
std::string GetOutput () const
 

Detailed Description

Definition at line 20 of file stream_capture.h.

Constructor & Destructor Documentation

◆ StreamCapture()

flutter::testing::StreamCapture::StreamCapture ( std::ostream *  ostream)
explicit

Definition at line 9 of file stream_capture.cc.

10 : ostream_(ostream), old_buffer_(ostream_->rdbuf()) {
11 ostream_->rdbuf(buffer_.rdbuf());
12}

◆ ~StreamCapture()

flutter::testing::StreamCapture::~StreamCapture ( )

Definition at line 14 of file stream_capture.cc.

References Stop().

Member Function Documentation

◆ GetOutput()

std::string flutter::testing::StreamCapture::GetOutput ( ) const

Definition at line 25 of file stream_capture.cc.

25 {
26 return buffer_.str();
27}

Referenced by flutter::testing::TEST_F().

◆ Stop()

void flutter::testing::StreamCapture::Stop ( )

Definition at line 18 of file stream_capture.cc.

18 {
19 if (old_buffer_) {
20 ostream_->rdbuf(old_buffer_);
21 old_buffer_ = nullptr;
22 }
23}

Referenced by flutter::testing::TEST_F(), and ~StreamCapture().


The documentation for this class was generated from the following files: