Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
Loading...
Searching...
No Matches
stream_capture.cc
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#include "
flutter/testing/stream_capture.h
"
6
7
namespace
flutter::testing
{
8
9
StreamCapture::StreamCapture
(std::ostream* ostream)
10
: ostream_(ostream), old_buffer_(ostream_->rdbuf()) {
11
ostream_->rdbuf(buffer_.rdbuf());
12
}
13
14
StreamCapture::~StreamCapture
() {
15
Stop
();
16
}
17
18
void
StreamCapture::Stop
() {
19
if
(old_buffer_) {
20
ostream_->rdbuf(old_buffer_);
21
old_buffer_ =
nullptr
;
22
}
23
}
24
25
std::string
StreamCapture::GetOutput
()
const
{
26
return
buffer_.str();
27
}
28
29
}
// namespace flutter::testing
flutter::testing::StreamCapture::~StreamCapture
~StreamCapture()
Definition
stream_capture.cc:14
flutter::testing::StreamCapture::Stop
void Stop()
Definition
stream_capture.cc:18
flutter::testing::StreamCapture::StreamCapture
StreamCapture(std::ostream *ostream)
Definition
stream_capture.cc:9
flutter::testing::StreamCapture::GetOutput
std::string GetOutput() const
Definition
stream_capture.cc:25
flutter::testing
Definition
native_assets_unittests.cc:10
stream_capture.h
testing
stream_capture.cc
Generated on Tue Dec 2 2025 04:46:44 for Flutter Engine Uber Docs by
1.9.8