1 #ifndef BLANK_APP_PROCESS_HPP_
2 #define BLANK_APP_PROCESS_HPP_
14 /// launch process executing the file at given path with
15 /// given arguments and environment
17 const std::string &path,
18 const std::vector<std::string> &args,
19 const std::vector<std::string> &env);
23 /// write to the process' input stream
24 /// data is taken from given buffer, at most max_len bytes
25 /// @return the number of bytes written
26 std::size_t WriteIn(const void *buffer, std::size_t max_len);
27 /// read from the process' output stream
28 /// data is stored in the given buffer, at most max_len bytes
29 /// @return the number of bytes read
30 std::size_t ReadOut(void *buffer, std::size_t max_len);
31 /// read from the process' error stream
32 /// data is stored in the given buffer, at most max_len bytes
33 /// @return the number of bytes read
34 std::size_t ReadErr(void *buffer, std::size_t max_len);
36 /// ask the process nicely to terminate
39 /// wait until the process exits and fetch its exit status
44 std::unique_ptr<Impl> impl;