00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef FXPROCESS_H
00022 #define FXPROCESS_H
00023
00024 namespace FX {
00025
00027
00028 class FXIODevice;
00029
00030
00032 #if defined(WIN32)
00033 typedef void* FXProcessID;
00034 #else
00035 typedef int FXProcessID;
00036 #endif
00037
00038
00040 class FXAPI FXProcess {
00041 private:
00042 FXProcessID pid;
00043 FXIODevice *input;
00044 FXIODevice *output;
00045 FXIODevice *errors;
00046 private:
00047 FXProcess(const FXProcess&);
00048 FXProcess &operator=(const FXProcess&);
00049 public:
00050
00052 FXProcess();
00053
00055 FXProcessID id() const;
00056
00058 FXbool start(const FXchar* exec,const FXchar *const *args,const FXchar *const *env=NULL);
00059
00061 void setInputStream(FXIODevice* is){ input=is; }
00062
00064 FXIODevice* getInputStream() const { return input; }
00065
00067 void setOutputStream(FXIODevice* os){ output=os; }
00068
00070 FXIODevice* getOutputStream() const { return output; }
00071
00073 void setErrorStream(FXIODevice* es){ errors=es; }
00074
00076 FXIODevice* getErrorStream() const { return errors; }
00077
00079 static FXint current();
00080
00082 static void exit(FXint code=0);
00083
00085 FXbool suspend();
00086
00088 FXbool resume();
00089
00091 FXbool kill();
00092
00094 FXbool wait();
00095
00097 FXbool wait(FXint& code);
00098
00100 ~FXProcess();
00101 };
00102
00103 }
00104
00105 #endif