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
26 * Outputs to the console terminal the line buffered standard output and
27 * error of a spawned process when there is a controlling terminal and
28 * stdout/stderr have not been redirected.
30 class SystemcallPrivate : public QObject
35 SystemcallPrivate(std::string const & outfile);
46 bool waitWhile(State, bool processEvents, int timeout = -1);
47 void startProcess(const QString& cmd);
51 QString errorMessage() const;
52 QString exitStatusMessage() const;
54 QProcess* releaseProcess();
56 static void killProcess(QProcess * p);
62 void processError(QProcess::ProcessError);
63 void processStarted();
64 void processFinished(int, QProcess::ExitStatus status);
68 /// Pointer to the process to monitor.
71 /// Index to the standard output buffer.
73 /// Index to the standard error buffer.
76 std::string out_file_;
79 static size_t const buffer_size_ = 200;
80 /// Standard output buffer.
81 char out_data_[buffer_size_];
82 /// Standard error buffer.
83 char err_data_[buffer_size_];
88 void waitAndProcessEvents();
94 } // namespace support
97 #endif // SYSTEMCALLPRIVATE_H