39 #define NOTQTPROCESS_MAIN_APP 0 40 #define NOTQTPROCESS_FAILURE -1 43 #define NOTQPROCNOERROR 0 44 #define NOTQPROCFAILEDTOSTART 1 45 #define NOTQPROCCRASHED 2 46 #define NOTQPROCTIMEDOUT 3 47 #define NOTQPROCWRITEERR 4 48 #define NOTQPROCREADERR 5 49 #define NOTQPROCUNKNOWN 6 54 extern ofstream debugLogFile;
55 # define dbgln(msg) debugLogFile << __FUNCTION__ << ": " << msg << endl; 56 # define dbglln(msg) debugLogFile << __PRETTY_FUNCTION__ << ": " << msg << endl; 57 # define dbg(msg) debugLogFile << msg; 76 virtual void startedSignal (
string) {}
77 virtual void errorSignal (
int) {}
78 virtual void processFinishedSignal (
string) {}
79 virtual void readyReadStandardOutputSignal (
void) {}
80 virtual void readyReadStandardErrorSignal (
void) {}
94 void writeIn (
string& input);
98 int start (
const string& program,
const list<string>& args);
102 void terminate (
void);
112 void probeProcess (
void);
118 pid_t
getPid (
void) {
return this->pid; }
119 int getError (
void) {
return this->error; }
120 void setError (
int e) { this->error = e; }
124 this->parentFD = this->parentToChild[1];
125 close(this->childToParent[0]);
128 pipe(this->parentToChild);
129 pipe(this->childToParent);
131 return this->parentFD;
144 string readAllStandardOutput (
void);
145 string readAllStandardError (
void);
151 bool waitForStarted (
void);
161 list<string> environment;
179 int parentToChild[2];
183 int childToParent[2];
187 int childErrToParent[2];
220 void write (
string input);
228 string fileName (
void);
255 static string simplify (
string& input);
259 static void splitString (
string& line,
char token, vector<string>& rtn);
263 static void splitString (
string& line,
char token, list<string>& rtn);
267 static int ensureUnixNewlines (std::string& input);
void setCallbacks(notQProcessCallbacks *cb)