~ubuntu-branches/ubuntu/lucid/codelite/lucid

« back to all changes in this revision

Viewing changes to Plugin/pipedprocess.h

  • Committer: Bazaar Package Importer
  • Author(s): Chow Loong Jin
  • Date: 2009-01-12 15:46:55 UTC
  • Revision ID: james.westby@ubuntu.com-20090112154655-sdynrljcb6u167yw
Tags: upstream-1.0.2674+dfsg
ImportĀ upstreamĀ versionĀ 1.0.2674+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//////////////////////////////////////////////////////////////////////////////
 
2
//////////////////////////////////////////////////////////////////////////////
 
3
//
 
4
// copyright            : (C) 2008 by Eran Ifrah                            
 
5
// file name            : pipedprocess.h              
 
6
//                                                                          
 
7
// -------------------------------------------------------------------------
 
8
// A                                                                        
 
9
//              _____           _      _     _ _                            
 
10
//             /  __ \         | |    | |   (_) |                           
 
11
//             | /  \/ ___   __| | ___| |    _| |_ ___                      
 
12
//             | |    / _ \ / _  |/ _ \ |   | | __/ _ )                     
 
13
//             | \__/\ (_) | (_| |  __/ |___| | ||  __/                     
 
14
//              \____/\___/ \__,_|\___\_____/_|\__\___|                     
 
15
//                                                                          
 
16
//                                                  F i l e                 
 
17
//                                                                          
 
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.                                   
 
22
//                                                                          
 
23
//////////////////////////////////////////////////////////////////////////////
 
24
//////////////////////////////////////////////////////////////////////////////
 
25
 #ifndef PipedProcess_H
 
26
#define PipedProcess_H
 
27
 
 
28
#include "wx/process.h"
 
29
#include "wx/string.h"
 
30
 
 
31
class PipedProcess : public wxProcess
 
32
{
 
33
        long m_pid;
 
34
        wxString m_cmd;
 
35
 
 
36
public:
 
37
        /**
 
38
         * Constructs a process object. id is only used in the case you want to use wxWidgets events. 
 
39
         * It identifies this object, or another window that will receive the event.
 
40
         */
 
41
        PipedProcess(int id, const wxString &cmdLine);
 
42
 
 
43
        virtual ~PipedProcess();
 
44
 
 
45
        /**
 
46
         * \return return the process id
 
47
         */
 
48
        long GetPid();
 
49
 
 
50
        /**
 
51
         * \param set the process ID
 
52
         */
 
53
        void SetPid(long pid);
 
54
 
 
55
        /**
 
56
         * Kill the process
 
57
         */
 
58
        void Terminate();
 
59
 
 
60
        /** 
 
61
         * Start the process
 
62
         * \return the process id
 
63
         */
 
64
        virtual long Start(bool hide = true);
 
65
        
 
66
        virtual bool HasInput(wxString &input);
 
67
        
 
68
        /**
 
69
         * \brief read all input from the process output stream
 
70
         * \param input
 
71
         * \return true if some data was read, false otherwise
 
72
         */
 
73
        virtual bool ReadAll(wxString &input);
 
74
};
 
75
 
 
76
#endif // PipedProcess_H
 
77