00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
#ifndef WT_PROC_WIN_H
00023
#define WT_PROC_WIN_H
00024
00025
#include <wefts_os.h>
00026
#include <wefts_coffee_base.h>
00027
00028
namespace Wefts
00029 {
00030
00041 class OSProcessWin:
public OSProcessBase
00042 {
00043 CRITICAL_SECTION
m_mutex;
00044 HANDLE
m_pid;
00045
00046 HANDLE
m_childIn,
m_childOut,
m_childErr;
00047 bool m_sinkIn,
m_sinkOut,
m_sinkErr;
00048
00049
void detachUnlocked();
00050
00051
static int parametrize(
char *dese,
const char *src );
00052
static char **
argvize(
char *dest,
int size );
00053
public:
00054
00055
OSProcessWin();
00056
~OSProcessWin();
00057
00058
virtual bool running();
00059
virtual bool wait(
const double seconds=-1.0 );
00060
virtual bool start(
const std::string process,
bool useShell=
false,
bool usePath=
true );
00061
virtual bool stop();
00062
virtual bool getProcessValue(
int &retvalue )
const;
00063
virtual file_size_t getProcessId() const;
00064 virtual
int write( const
void *data, const
int size, const
double seconds=-1.0 );
00065 virtual
int read(
void *data, const
int size, const
double seconds=-1.0 );
00066 virtual
int readStdErr(
void *data, const
int size, const
double seconds=-1.0 );
00067 virtual
void mergeStdErr();
00068 virtual
void detach();
00069
00070 virtual
void sinkInput();
00071 virtual
void sinkOutput();
00072 virtual
void sinkError();
00073
00074 virtual
bool closeRead();
00075 virtual
bool closeWrite();
00076 virtual
bool closeStdErr();
00077 virtual
void handleCleanup(
int code,
void *caller=0 );
00078 };
00079
00080 typedef
OSProcessWin Process;
00081
00082 }
00083 #endif
00084
00085