Back to index

texmacs  1.0.7.15
Public Slots | Public Member Functions | Public Attributes
QTMPipeLink Class Reference

#include <QTMPipeLink.hpp>

Collaboration diagram for QTMPipeLink:
Collaboration graph
[legend]

List of all members.

Public Slots

void readErrOut ()

Public Member Functions

 QTMPipeLink (string)
 ~QTMPipeLink ()
void setOutbuf (string out)
void setErrbuf (string err)
stringgetOutbuf ()
stringgetErrbuf ()
bool launchCmd ()
int writeStdin (string s)
void feedBuf (ProcessChannel)
bool listenChannel (ProcessChannel, int msecs)
void killProcess ()

Public Attributes

string cmd
string outbuf
string errbuf
commandfeed_cmd

Detailed Description

Definition at line 19 of file QTMPipeLink.hpp.


Constructor & Destructor Documentation

Definition at line 37 of file QTMPipeLink.cpp.

: cmd (cmd2), outbuf (""), errbuf ("") {}

Definition at line 39 of file QTMPipeLink.cpp.

                           {
  killProcess ();
}

Here is the call graph for this function:


Member Function Documentation

void QTMPipeLink::feedBuf ( ProcessChannel  channel)

Definition at line 67 of file QTMPipeLink.cpp.

                                            {
  setReadChannel (channel);
  QByteArray tempout = QIODevice::readAll ();
  if (channel == QProcess::StandardOutput) outbuf << tempout.constData ();
  else errbuf << tempout.constData ();
  if (DEBUG_IO)
    cout << "[OUTPUT " << channel << "]" << debug_io_string (tempout.constData ()) << "\n";
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 37 of file QTMPipeLink.hpp.

{ return errbuf; }

Definition at line 36 of file QTMPipeLink.hpp.

{ return outbuf; }

Definition at line 83 of file QTMPipeLink.cpp.

                          {
  disconnect (SIGNAL(readyReadStandardOutput ()), this, SLOT(readErrOut ()));
  disconnect (SIGNAL(readyReadStandardError ()), this, SLOT(readErrOut ()));
#if defined(__MINGW__) || defined(__MINGW32__)
  close ();
#else
  terminate ();
  if (! waitForFinished ()) kill ();
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 44 of file QTMPipeLink.cpp.

                        {
  if (state () != QProcess::NotRunning) killProcess ();
  char* _cmd = as_charp (cmd);
  QProcess::start (_cmd);
  tm_delete_array (_cmd);
  bool r= waitForStarted ();
  if (r) {
    connect (this, SIGNAL(readyReadStandardOutput ()), SLOT(readErrOut ()));
    connect (this, SIGNAL(readyReadStandardError ()), SLOT(readErrOut ()));
  }
  return r;
}

Here is the call graph for this function:

bool QTMPipeLink::listenChannel ( ProcessChannel  channel,
int  msecs 
)

Definition at line 77 of file QTMPipeLink.cpp.

                                                             {
  setReadChannel (channel);
  return waitForReadyRead (msecs);
}
void QTMPipeLink::readErrOut ( ) [slot]

Definition at line 32 of file QTMPipeLink.cpp.

                         {
  feedBuf (QProcess::StandardError);
  feedBuf (QProcess::StandardOutput);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void QTMPipeLink::setErrbuf ( string  err) [inline]

Definition at line 35 of file QTMPipeLink.hpp.

{ errbuf= err; }
void QTMPipeLink::setOutbuf ( string  out) [inline]

Definition at line 34 of file QTMPipeLink.hpp.

{ outbuf= out; }

Definition at line 58 of file QTMPipeLink.cpp.

                                 {
  char* _s= as_charp (s);
  if (DEBUG_IO) cout << "[INPUT]" << debug_io_string (_s);
  int err= QIODevice::write (_s, N(s));
  tm_delete_array (_s);
  return err;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 26 of file QTMPipeLink.hpp.

Definition at line 28 of file QTMPipeLink.hpp.

Definition at line 29 of file QTMPipeLink.hpp.

Definition at line 27 of file QTMPipeLink.hpp.


The documentation for this class was generated from the following files: