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;
56 QProcess* releaseProcess();
58 static void killProcess(QProcess * p);
64 void processError(QProcess::ProcessError);
65 void processStarted();
66 void processFinished(int, QProcess::ExitStatus status);
70 /// Pointer to the process to monitor.
73 /// Index to the standard output buffer.
75 /// Index to the standard error buffer.
78 std::string out_file_;
81 static size_t const max_buffer_size_ = 200;
82 /// Standard output buffer.
83 char out_data_[max_buffer_size_];
84 /// Standard error buffer.
85 char err_data_[max_buffer_size_];
93 void waitAndProcessEvents();
99 } // namespace support
102 #endif // SYSTEMCALLPRIVATE_H