Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
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 21 of file stream_capture.h.

Constructor & Destructor Documentation

◆ StreamCapture()

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

Definition at line 10 of file stream_capture.cc.

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

◆ ~StreamCapture()

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

Definition at line 15 of file stream_capture.cc.

Member Function Documentation

◆ GetOutput()

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

Definition at line 26 of file stream_capture.cc.

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

◆ Stop()

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

Definition at line 19 of file stream_capture.cc.

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

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