/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
deps/v8/src/utils/output-stream.h
43 строки
1 KB
Michaël Zasso
deps: update V8 to 14.3.127.12
13 ноя 2025, 17:08
Не верифицирован
13 ноя 2025, 17:08
53379f3
Код
Авторство
О чём код?
// Copyright 2025 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef V8_UTILS_OUTPUT_STREAM_H_ #define V8_UTILS_OUTPUT_STREAM_H_ #include <fstream> #include <sstream> #include "include/v8-profiler.h" #include "src/base/macros.h" namespace v8::internal { class V8_EXPORT_PRIVATE FileOutputStream : public v8::OutputStream { public: explicit FileOutputStream(const char* filename) : os_(filename) {} ~FileOutputStream() override { os_.close(); } WriteResult WriteAsciiChunk(char* data, int size) override; void EndOfStream() override; bool IsOpen() const { return os_.is_open(); } private: std::ofstream os_; }; class V8_EXPORT_PRIVATE StringOutputStream : public v8::OutputStream { public: WriteResult WriteAsciiChunk(char* data, int size) override; void EndOfStream() override {} std::string str(); private: std::stringstream os_; }; } // namespace v8::internal #endif // V8_UTILS_OUTPUT_STREAM_H_