X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fbase%2Fconsole.h;h=60540da04c26d1908f04f48165b4fd7a6a0a1101;hp=ddfd82a9d9d4ea7a298066d63e5b9cce68063064;hb=1a2a0e2f94f8f9ba64b1e2d11b42bec88ed612d0;hpb=f0eb06742afb77ddf4ea856493ff47bf836be0a2 diff --git a/lib/base/console.h b/lib/base/console.h index ddfd82a..60540da 100644 --- a/lib/base/console.h +++ b/lib/base/console.h @@ -6,41 +6,47 @@ #include #include -#ifndef SWIG struct queue_data { queue_data( char *data, int len ) - :data(data), len(len) + :data(data), len(len), dataSent(0) { } char *data; int len; + int dataSent; }; -#endif -class eConsoleAppContainer: public Object +class eConsoleAppContainer: public Object, public iObject { -#ifndef SWIG + DECLARE_REF(eConsoleAppContainer); int fd[3]; + int filefd[3]; int pid; int killstate; + std::string m_cwd; std::queue outbuf; - eSocketNotifier *in, *out, *err; + ePtr in, out, err; void readyRead(int what); void readyErrRead(int what); void readyWrite(int what); void closePipes(); -#endif public: eConsoleAppContainer(); - int execute( const std::string &str ); ~eConsoleAppContainer(); + int setCWD( const char *path ); + int execute( const char *str ); + int execute( const char *cmdline, const char *const argv[] ); int getPID() { return pid; } void kill(); void sendCtrlC(); + void sendEOF(); void write( const char *data, int len ); + void setFileFD(int num, int fd) { if (num >= 0 && num <= 2) filefd[num] = fd; } bool running() { return (fd[0]!=-1) && (fd[1]!=-1) && (fd[2]!=-1); } PSignal1 dataAvail; + PSignal1 stdoutAvail; + PSignal1 stderrAvail; PSignal1 dataSent; PSignal1 appClosed; };