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(QProcess * proc);
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);
53 QString errorMessage() const;
54 QString exitStatusMessage() const;
59 /// Pointer to the process to monitor.
61 /// Index to the standard output buffer.
63 /// Index to the standard error buffer.
66 static size_t const bufsize_ = 200;
67 /// Standard output buffer.
68 char outdata_[bufsize_];
69 /// Standard error buffer.
70 char errdata_[bufsize_];
76 void waitAndProcessEvents();
81 void processError(QProcess::ProcessError);
82 void processStarted();
83 void processFinished(int, QProcess::ExitStatus status);
87 } // namespace support
90 #endif // SYSTEMCALLPRIVATE_H