MCPcopy Create free account
hub / github.com/boostorg/asio / copy

Method copy

include/boost/asio/impl/buffered_write_stream.hpp:369–380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367template <typename Stream>
368template <typename ConstBufferSequence>
369std::size_t buffered_write_stream<Stream>::copy(
370 const ConstBufferSequence& buffers)
371{
372 using boost::asio::buffer_size;
373 std::size_t orig_size = storage_.size();
374 std::size_t space_avail = storage_.capacity() - orig_size;
375 std::size_t bytes_avail = buffer_size(buffers);
376 std::size_t length = bytes_avail < space_avail ? bytes_avail : space_avail;
377 storage_.resize(orig_size + length);
378 return boost::asio::buffer_copy(
379 storage_.data() + orig_size, buffers, length);
380}
381
382BOOST_ASIO_INLINE_NAMESPACE_END
383} // namespace asio

Callers 3

write_someMethod · 0.95
any_executor_baseMethod · 0.45
any_executor_baseClass · 0.45

Calls 6

buffer_sizeFunction · 0.85
buffer_copyFunction · 0.85
sizeMethod · 0.45
capacityMethod · 0.45
resizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected