|
a/src/utils/execmd.h |
|
b/src/utils/execmd.h |
|
... |
|
... |
14 |
* Free Software Foundation, Inc.,
|
14 |
* Free Software Foundation, Inc.,
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
16 |
*/
|
16 |
*/
|
17 |
#ifndef _EXECMD_H_INCLUDED_
|
17 |
#ifndef _EXECMD_H_INCLUDED_
|
18 |
#define _EXECMD_H_INCLUDED_
|
18 |
#define _EXECMD_H_INCLUDED_
|
19 |
/* @(#$Id: execmd.h,v 1.10 2006-10-11 16:09:45 dockes Exp $ (C) 2004 J.F.Dockes */
|
19 |
/* @(#$Id: execmd.h,v 1.11 2006-12-14 13:53:43 dockes Exp $ (C) 2004 J.F.Dockes */
|
20 |
|
20 |
|
21 |
#include <string>
|
21 |
#include <string>
|
22 |
#include <list>
|
22 |
#include <list>
|
|
|
23 |
#include <vector>
|
23 |
#ifndef NO_NAMESPACES
|
24 |
#ifndef NO_NAMESPACES
|
24 |
using std::list;
|
25 |
using std::list;
|
25 |
using std::string;
|
26 |
using std::string;
|
|
|
27 |
using std::vector;
|
26 |
#endif
|
28 |
#endif
|
27 |
|
29 |
|
28 |
/** Callback function object to advise of new data arrival (or just heartbeat) * if cnt is 0 */
|
30 |
/** Callback function object to advise of new data arrival (or just heartbeat) * if cnt is 0 */
|
29 |
class ExecCmdAdvise {
|
31 |
class ExecCmdAdvise {
|
30 |
public:
|
32 |
public:
|
|
... |
|
... |
115 |
|
117 |
|
116 |
ExecCmd()
|
118 |
ExecCmd()
|
117 |
: m_advise(0), m_provide(0), m_cancelRequest(false), m_timeoutMs(1000)
|
119 |
: m_advise(0), m_provide(0), m_cancelRequest(false), m_timeoutMs(1000)
|
118 |
{}
|
120 |
{}
|
119 |
|
121 |
|
|
|
122 |
/**
|
|
|
123 |
* Utility routine: check if/where a command is found according to the
|
|
|
124 |
* current PATH
|
|
|
125 |
*/
|
|
|
126 |
static bool which(const string& cmd, string& path);
|
|
|
127 |
|
120 |
private:
|
128 |
private:
|
121 |
list<string> m_env;
|
129 |
vector<string> m_env;
|
122 |
ExecCmdAdvise *m_advise;
|
130 |
ExecCmdAdvise *m_advise;
|
123 |
ExecCmdProvide *m_provide;
|
131 |
ExecCmdProvide *m_provide;
|
124 |
bool m_cancelRequest;
|
132 |
bool m_cancelRequest;
|
125 |
int m_timeoutMs;
|
133 |
int m_timeoutMs;
|
126 |
string m_stderrFile;
|
134 |
string m_stderrFile;
|
127 |
};
|
135 |
};
|
128 |
|
136 |
|
129 |
|
137 |
|
130 |
#endif /* _EXECMD_H_INCLUDED_ */
|
138 |
#endif /* _EXECMD_H_INCLUDED_ */
|