MCPcopy Create free account
hub / github.com/alandefreitas/matplotplusplus / write

Method write

source/matplot/util/popen.cpp:208–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206opipe::opipe() = default; // starting with C++20 could be in-class
207
208int opipe::write(std::string_view data)
209{
210 constexpr auto CSIZE = sizeof(std::string_view::value_type);
211 if (!opened())
212 return report(EINVAL, "opipe::write");
213 if (auto sz = std::fwrite(data.data(), CSIZE, data.length(), file_);
214 sz != data.size()) {
215 if (auto err = std::ferror(file_); err != 0)
216 return report(EIO, "fwrite error");
217 if (auto err = std::feof(file_); err != 0)
218 return report(EIO, "fwrite eof");
219 }
220 return 0;
221}
222
223int opipe::flush(std::string_view data)
224{

Callers 2

run_commandMethod · 0.45
shell_writeFunction · 0.45

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected