Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXProcess.h
1 /********************************************************************************
2 * *
3 * P r o c e s s S u p p o r t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1997,2021 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXPROCESS_H
22 #define FXPROCESS_H
23 
24 namespace FX {
25 
26 class FXIODevice;
27 
28 
30 class FXAPI FXProcess {
31 private:
32  FXProcessID pid; // Handle to process
33  FXIODevice *input; // Input stream
34  FXIODevice *output; // Output stream
35  FXIODevice *errors; // Errors stream
36 private:
37  FXProcess(const FXProcess&);
38  FXProcess &operator=(const FXProcess&);
39 public:
40 
42  FXProcess();
43 
45  FXProcessID id() const;
46 
48  FXbool start(const FXchar* exec,const FXchar *const *args,const FXchar *const *env=NULL);
49 
51  void setInputStream(FXIODevice* is){ input=is; }
52 
54  FXIODevice* getInputStream() const { return input; }
55 
57  void setOutputStream(FXIODevice* os){ output=os; }
58 
60  FXIODevice* getOutputStream() const { return output; }
61 
63  void setErrorStream(FXIODevice* es){ errors=es; }
64 
66  FXIODevice* getErrorStream() const { return errors; }
67 
69  static FXint current();
70 
72  static void exit(FXint code=0);
73 
75  FXbool suspend();
76 
78  FXbool resume();
79 
81  FXbool kill();
82 
84  FXbool wait();
85 
87  FXbool wait(FXint& code);
88 
90  ~FXProcess();
91  };
92 
93 }
94 
95 #endif
FXIODevice * getInputStream() const
Return input stream.
Definition: FXProcess.h:54
Executable process.
Definition: FXProcess.h:30
void setOutputStream(FXIODevice *os)
Change output stream; handle must be Inheritable.
Definition: FXProcess.h:57
FXIODevice * getErrorStream() const
Return error stream.
Definition: FXProcess.h:66
FXIODevice * getOutputStream() const
Return output stream.
Definition: FXProcess.h:60
Definition: FX4Splitter.h:28
void setInputStream(FXIODevice *is)
Change input stream; handle must be Inheritable.
Definition: FXProcess.h:51
void setErrorStream(FXIODevice *es)
Change error stream; handle must be Inheritable.
Definition: FXProcess.h:63
FXIODevice manipulates a handle to operating system i/o device, such as pipes, sockets, or files.
Definition: FXIODevice.h:35

Copyright © 1997-2020 Jeroen van der Zijp