summaryrefslogtreecommitdiffstats
path: root/src/processexec.h
blob: 7de8c623c0147bea5e84c24d8c7fcd3d7d6b69f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/***************************************************************************
                          processexec.h  -  description
                             -------------------
    begin                : sáb abr 27 2002
    copyright            : (C) 2002 by asdf
    email                : dsf
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef PROCESSEXEC_H
#define PROCESSEXEC_H

#include <unistd.h>
#include <kprocess.h>

/**
  *@author asdf
  */

class ProcessExec : public TDEProcess  {
TQ_OBJECT
public:
	ProcessExec();
	~ProcessExec();

  bool run();
  bool runAndWait();
  bool outputErrors()				{ return fErrors; };

  inline TQString getStdoutData()		{ return buffer; };
  inline unsigned int getStdoutDataLen()	{ return buffer.length(); }
  inline void clearData()			{ buffer.truncate(0); fErrors= false; };

protected slots:

 void slotReceivedStdout(TDEProcess *proc, char *buf, int len);
 void slotReceivedStderr(TDEProcess *proc, char *buf, int len);

private:

  static const int bufMax= 1023;
  TQString buffer;
  bool fErrors;
};

#endif