source: main/trunk/greenstone2/runtime-src/src/recpt/os_process_windows.h@ 22173

Last change on this file since 22173 was 22173, checked in by davidb, 14 years ago

Some initial development on the ability to have bi-directional pipes to spawned processes (with no DOS windows being opened up in the case of Windows). Think popen2()

  • Property svn:executable set to *
File size: 2.0 KB
Line 
1/**********************************************************************
2 *
3 * os_process_windows.h -- Windows version of osprocess. See os_process.h
4 * for more details
5 *
6 * Copyright (C) 2010 The New Zealand Digital Library Project
7 *
8 * A component of the Greenstone digital library software
9 * from the New Zealand Digital Library Project at the
10 * University of Waikato, New Zealand.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 *
26 *********************************************************************/
27
28#ifndef OS_PROCESS_WINDOWS_H
29#define OS_PROCESS_WINDOWS_H
30
31#ifdef __WIN32__
32
33#include "os_process.h"
34
35#include <windows.h>
36
37class osprocesswindows : osprocess
38{
39public:
40 osprocesswindows(char* cmdline);
41 osprocesswindows(char* cmdline, OSProcessPipeMode mode);
42 virtual ~osprocesswindows();
43
44 /*
45 virtual bool eop(); // end of pipe
46 virtual bool eop(OSProcessPipeMode); // end of pipe, for designated pipe
47 */
48
49 virtual int read(char* buffer, const int buffer_len);
50 virtual int write(const char* buffer, const int buffer_len);
51
52 virtual bool close();
53 virtual bool close(OSProcessPipeMode mode);
54
55protected:
56 PROCESS_INFORMATION pi_;
57
58 HANDLE child_stdin_write_;
59 HANDLE child_stdout_read_;
60};
61
62#endif
63
64#endif
Note: See TracBrowser for help on using the repository browser.