diff options
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/vcpkg/base/system.print.h | 23 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg/binarycaching.h | 3 |
2 files changed, 24 insertions, 2 deletions
diff --git a/toolsrc/include/vcpkg/base/system.print.h b/toolsrc/include/vcpkg/base/system.print.h index 890c13667..abe685cf5 100644 --- a/toolsrc/include/vcpkg/base/system.print.h +++ b/toolsrc/include/vcpkg/base/system.print.h @@ -41,4 +41,27 @@ namespace vcpkg::System { ::vcpkg::System::details::print(Strings::concat_or_view(args...)); } + + class BufferedPrint + { + ::std::string stdout_buffer; + static constexpr ::std::size_t buffer_size_target = 2048; + static constexpr ::std::size_t expected_maximum_print = 256; + static constexpr ::std::size_t alloc_size = buffer_size_target + expected_maximum_print; + + public: + BufferedPrint() { stdout_buffer.reserve(alloc_size); } + BufferedPrint(const BufferedPrint&) = delete; + BufferedPrint& operator=(const BufferedPrint&) = delete; + void append(::vcpkg::StringView nextView) + { + stdout_buffer.append(nextView.data(), nextView.size()); + if (stdout_buffer.size() > buffer_size_target) + { + ::vcpkg::System::details::print(stdout_buffer); + stdout_buffer.clear(); + } + } + ~BufferedPrint() { ::vcpkg::System::details::print(stdout_buffer); } + }; } diff --git a/toolsrc/include/vcpkg/binarycaching.h b/toolsrc/include/vcpkg/binarycaching.h index d343d6c42..61af79a3f 100644 --- a/toolsrc/include/vcpkg/binarycaching.h +++ b/toolsrc/include/vcpkg/binarycaching.h @@ -40,8 +40,7 @@ namespace vcpkg /// Requests the result of `try_restore()` without actually downloading the package. Used by CI to determine
/// missing packages.
virtual RestoreResult precheck(const VcpkgPaths& paths,
- const Dependencies::InstallPlanAction& action,
- bool purge_tombstones) = 0;
+ const Dependencies::InstallPlanAction& action) = 0;
};
IBinaryProvider& null_binary_provider();
|
