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 showout() { showout_ = true; }
39 /// Should the standard error be displayed?
40 void showerr() { showerr_ = true; }
50 bool waitWhile(State, bool processEvents, int timeout = -1);
51 void startProcess(const QString& cmd);
55 QString errorMessage() const;
56 QString exitStatusMessage() const;
60 static void killProcess(QProcess * p);
63 /// Pointer to the process to monitor.
65 /// Index to the standard output buffer.
67 /// Index to the standard error buffer.
72 static size_t const bufsize_ = 200;
73 /// Standard output buffer.
74 char outdata_[bufsize_];
75 /// Standard error buffer.
76 char errdata_[bufsize_];
82 void waitAndProcessEvents();
87 void processError(QProcess::ProcessError);
88 void processStarted();
89 void processFinished(int, QProcess::ExitStatus status);
93 } // namespace support
96 #endif // SYSTEMCALLPRIVATE_H