process.h 509 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef BB_STD_PROCESS_H
  2. #define BB_STD_PROCESS_H
  3. #include <bbmonkey.h>
  4. class bbProcess : public bbObject{
  5. public:
  6. bbProcess();
  7. ~bbProcess();
  8. void discard();
  9. bbFunction<void()> finished;
  10. bbFunction<void()> stdoutReady;
  11. bbBool start( bbString cmd );
  12. bbInt exitCode();
  13. bbInt stdoutAvail();
  14. bbString readStdout();
  15. bbInt readStdout( void *buf,bbInt count );
  16. void writeStdin( bbString str );
  17. void sendBreak();
  18. void terminate();
  19. private:
  20. struct Rep;
  21. Rep *_rep;
  22. };
  23. #endif