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

Function write

test/os-test.cc:138–148  ·  view source on GitHub ↗

Attempts to write a string to a file.

Source from the content-addressed store, hash-verified

136
137// Attempts to write a string to a file.
138void write(file& f, fmt::string_view s) {
139 size_t num_chars_left = s.size();
140 const char* ptr = s.data();
141 do {
142 size_t count = f.write(ptr, num_chars_left);
143 ptr += count;
144 // We can't write more than size_t bytes since num_chars_left
145 // has type size_t.
146 num_chars_left -= count;
147 } while (num_chars_left != 0);
148}
149
150TEST(buffered_file_test, default_ctor) {
151 auto f = buffered_file();

Callers 5

TESTFunction · 0.70
writeMethod · 0.70
SendMethod · 0.50
WriteFunction · 0.50
writeMethod · 0.50

Calls 3

sizeMethod · 0.45
dataMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected