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
6
7namespace flutter::testing {
8
9StreamCapture::StreamCapture(std::ostream* ostream)
10 : ostream_(ostream), old_buffer_(ostream_->rdbuf()) {
11 ostream_->rdbuf(buffer_.rdbuf());
12}
13
17
19 if (old_buffer_) {
20 ostream_->rdbuf(old_buffer_);
21 old_buffer_ = nullptr;
22 }
23}
24
25std::string StreamCapture::GetOutput() const {
26 return buffer_.str();
27}
28
29} // namespace flutter::testing
StreamCapture(std::ostream *ostream)