Flutter Engine
The Flutter Engine
testing
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
{
8
namespace
testing {
9
10
StreamCapture::StreamCapture
(std::ostream* ostream)
11
: ostream_(ostream), old_buffer_(ostream_->rdbuf()) {
12
ostream_->rdbuf(buffer_.rdbuf());
13
}
14
15
StreamCapture::~StreamCapture
() {
16
Stop
();
17
}
18
19
void
StreamCapture::Stop
() {
20
if
(old_buffer_) {
21
ostream_->rdbuf(old_buffer_);
22
old_buffer_ =
nullptr
;
23
}
24
}
25
26
std::string
StreamCapture::GetOutput
()
const
{
27
return
buffer_.str();
28
}
29
30
}
// namespace testing
31
}
// namespace flutter
flutter::testing::StreamCapture::~StreamCapture
~StreamCapture()
Definition:
stream_capture.cc:15
flutter::testing::StreamCapture::Stop
void Stop()
Definition:
stream_capture.cc:19
flutter::testing::StreamCapture::StreamCapture
StreamCapture(std::ostream *ostream)
Definition:
stream_capture.cc:10
flutter::testing::StreamCapture::GetOutput
std::string GetOutput() const
Definition:
stream_capture.cc:26
flutter
Definition:
asset_manager.cc:10
Generated on Sun Jun 23 2024 21:55:19 for Flutter Engine by
1.9.4