process.h 575 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. bbInt writeStdin( bbString str );
  17. bbInt writeStdin( void *buf,bbInt count );
  18. void sendBreak();
  19. void terminate();
  20. private:
  21. struct Rep;
  22. Rep *_rep;
  23. void gcMark();
  24. };
  25. #endif