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

Method read

source/matplot/util/popen.cpp:235–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235int ipipe::read(std::string &data)
236{
237 if (!opened())
238 return report(EINVAL, "ipipe::read");
239 data.clear();
240 auto buffer = std::array<char, 128>{};
241 while (!std::feof(file_) && !std::ferror(file_)) {
242 auto count =
243 std::fread(buffer.data(), sizeof(char), buffer.size(), file_);
244 if (count > 0)
245 data.append(buffer.data(), count);
246 }
247 if (std::ferror(file_))
248 return report(EIO, "fread");
249 return 0;
250}
251
252int shell_write(const std::string &cmd, std::string &data)
253{

Callers 1

shell_readFunction · 0.80

Calls 2

clearMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected