38 #define NOTQTPROCESS_MAIN_APP 0 39 #define NOTQTPROCESS_FAILURE -1 42 #define NOTQPROCNOERROR 0 43 #define NOTQPROCFAILEDTOSTART 1 44 #define NOTQPROCCRASHED 2 45 #define NOTQPROCTIMEDOUT 3 46 #define NOTQPROCWRITEERR 4 47 #define NOTQPROCREADERR 5 48 #define NOTQPROCUNKNOWN 6 53 extern ofstream debugLogFile;
54 # define dbgln(msg) debugLogFile << __FUNCTION__ << ": " << msg << endl; 55 # define dbglln(msg) debugLogFile << __PRETTY_FUNCTION__ << ": " << msg << endl; 56 # define dbg(msg) debugLogFile << msg; 75 virtual void startedSignal (
string) {}
76 virtual void errorSignal (
int) {}
77 virtual void processFinishedSignal (
string) {}
78 virtual void readyReadStandardOutputSignal (
void) {}
79 virtual void readyReadStandardErrorSignal (
void) {}
93 void writeIn (
string& input);
97 int start (
const string& program,
const list<string>& args);
101 void terminate (
void);
111 void probeProcess (
void);
117 pid_t
getPid (
void) {
return this->pid; }
118 int getError (
void) {
return this->error; }
119 void setError (
int e) { this->error = e; }
123 this->parentFD = this->parentToChild[1];
124 close(this->childToParent[0]);
127 pipe(this->parentToChild);
128 pipe(this->childToParent);
130 return this->parentFD;
143 string readAllStandardOutput (
void);
144 string readAllStandardError (
void);
150 bool waitForStarted (
void);
160 list<string> environment;
178 int parentToChild[2];
182 int childToParent[2];
186 int childErrToParent[2];
219 void write (
string input);
227 string fileName (
void);
254 static string simplify (
string& input);
258 static void splitString (
string& line,
char token, vector<string>& rtn);
262 static void splitString (
string& line,
char token, list<string>& rtn);
266 static int ensureUnixNewlines (std::string& input);
void setCallbacks(notQProcessCallbacks *cb)