1
//////////////////////////////////////////////////////////////////////////////
2
//////////////////////////////////////////////////////////////////////////////
4
// copyright : (C) 2008 by Eran Ifrah
5
// file name : winprocess.h
7
// -------------------------------------------------------------------------
10
// / __ \ | | | | (_) |
11
// | / \/ ___ __| | ___| | _| |_ ___
12
// | | / _ \ / _ |/ _ \ | | | __/ _ )
13
// | \__/\ (_) | (_| | __/ |___| | || __/
14
// \____/\___/ \__,_|\___\_____/_|\__\___|
18
// This program is free software; you can redistribute it and/or modify
19
// it under the terms of the GNU General Public License as published by
20
// the Free Software Foundation; either version 2 of the License, or
21
// (at your option) any later version.
23
//////////////////////////////////////////////////////////////////////////////
24
//////////////////////////////////////////////////////////////////////////////
25
#ifndef __winprocess__
26
#define __winprocess__
30
#include <wx/string.h>
37
virtual ~WinProcess();
39
// Create process asynchronously and return a process object
40
static WinProcess* Execute(const wxString& cmd, wxString &errMsg, const wxString &workingDir = wxEmptyString);
42
// Read from process stdout - return immediately if no data is available
43
bool Read(wxString& buff);
45
// Write to the process stdin
46
bool Write(const wxString& buff);
48
// Return true if the process is still alive
51
// Clean the process resources and kill the process if it is
56
// WINDOWS implementation
57
// Creating process related handles
58
HANDLE hChildStdinRd, hChildStdinWr, hChildStdinWrDup,
59
hChildStdoutRd, hChildStdoutWr, hChildStdoutRdDup,
60
hSaveStdin, hSaveStdout;
62
// Child process id & information
64
PROCESS_INFORMATION piProcInfo;
69
#endif // __winprocess__