MCPcopy Create free account
hub / github.com/fmtlib/fmt / write_buffer

Function write_buffer

include/fmt/ostream.h:55–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53// It is a separate function rather than a part of vprint to simplify testing.
54template <typename Char>
55void write_buffer(std::basic_ostream<Char>& os, buffer<Char>& buf) {
56 const Char* buf_data = buf.data();
57 using unsigned_streamsize = make_unsigned_t<std::streamsize>;
58 unsigned_streamsize size = buf.size();
59 unsigned_streamsize max_size = to_unsigned(max_value<std::streamsize>());
60 do {
61 unsigned_streamsize n = size <= max_size ? size : max_size;
62 os.write(buf_data, static_cast<std::streamsize>(n));
63 buf_data += n;
64 size -= n;
65 } while (size != 0);
66}
67
68template <typename T> struct streamed_view {
69 const T& value;

Callers 4

TESTFunction · 0.85
vprintFunction · 0.85
ostream.hFile · 0.85
vprintFunction · 0.85

Calls 4

to_unsignedFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45
writeMethod · 0.45

Tested by 1

TESTFunction · 0.68