9 * Reads from a pipe when data is available, and hands data to registered callbacks.
17 * Construct new instance from pipe file descriptor.
18 * @param pipe_fd file descriptor for pipe we will read from (e.g., a subprocess's stdout, stderr pipes)
20 explicit pipe_reader(int pipe_fd);
23 * Read from pipe file descriptor and store data in buffer.
24 * This method is non-blocking, i.e., if there is no data to read, it returns immediately.
25 * Otherwise, it will read until either of the following conditions is met:
27 * - no more data left in the pipe to be read
28 * - buffer is completely filled
30 * On errors, a subprocess_error is thrown.
32 * @param buffer buffer to store read data into
33 * @returns amount of characters read from the pipe
35 size_t read(std::vector<std::string::value_type>& buffer) const;