Back to index

texmacs  1.0.7.15
QTMPipeLink.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : QTMPipeLink.hpp
00004 * DESCRIPTION: QT TeXmacs links - header file
00005 * COPYRIGHT  : (C) 2009 David MICHEL
00006 *******************************************************************************
00007 * This software falls under the GNU general public license version 3 or later.
00008 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00009 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00010 ******************************************************************************/
00011 
00012 #ifndef QTM_PIPE_LINK_H
00013 #define QTM_PIPE_LINK_H
00014 
00015 #include "string.hpp"
00016 #include "command.hpp"
00017 #include <QProcess>
00018 
00019 class QTMPipeLink : public QProcess {
00020   Q_OBJECT
00021 
00022 public slots:
00023   void readErrOut ();
00024 
00025 public:
00026   string cmd;
00027   string outbuf;
00028   string errbuf;
00029   command* feed_cmd;
00030 
00031   QTMPipeLink (string);
00032   ~QTMPipeLink ();
00033 
00034   inline void setOutbuf(string out) { outbuf= out; }
00035   inline void setErrbuf (string err) { errbuf= err; }
00036   inline string& getOutbuf() { return outbuf; }
00037   inline string& getErrbuf () { return errbuf; }
00038 
00039   bool launchCmd ();
00040   int  writeStdin (string s);
00041   void feedBuf (ProcessChannel);
00042   bool listenChannel (ProcessChannel, int msecs);
00043   void killProcess ();
00044 };
00045 
00046 #endif // QTM_PIPE_LINK
00047