3 * \file SystemcallPrivate.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Enrico Forestieri
9 * Full author contact details are available in file CREDITS.
12 #ifndef SYSTEMCALLPRIVATE_H
13 #define SYSTEMCALLPRIVATE_H
25 * Outputs to the console terminal the line buffered standard output and
26 * error of a spawned process when there is a controlling terminal and
27 * stdout/stderr have not been redirected.
29 class SystemcallPrivate : public QObject
33 SystemcallPrivate(const std::string& outfile);
36 /// Should the standard output be displayed?
37 void setShowOut(bool val) { showout_ = val; }
39 /// Should the standard error be displayed?
40 void setShowErr(bool val) { showerr_ = val; }
50 bool waitWhile(State, bool processEvents, int timeout = -1);
51 void startProcess(const QString& cmd);
55 QString errorMessage() const;
56 QString exitStatusMessage() const;
60 QProcess* releaseProcess();
62 static void killProcess(QProcess * p);
65 /// Pointer to the process to monitor.
67 /// Index to the standard output buffer.
69 /// Index to the standard error buffer.
74 static size_t const bufsize_ = 200;
75 /// Standard output buffer.
76 char outdata_[bufsize_];
77 /// Standard error buffer.
78 char errdata_[bufsize_];
86 void waitAndProcessEvents();
94 void processError(QProcess::ProcessError);
95 void processStarted();
96 void processFinished(int, QProcess::ExitStatus status);
102 } // namespace support
105 #endif // SYSTEMCALLPRIVATE_H