summaryrefslogtreecommitdiff
path: root/devtools/syncfrommirror/Redirect.h
blob: 560644d0014ed41583931592f10ef377cc3af1bf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//
//=============================================================================//
#include "redir.h"

#ifndef REDIRECT_H_INCLUDED__
#define REDIRECT_H_INCLUDED__

class CRedirect : public CRedirector
{
public:

	//--------------------------------------------------------------------------
	//	constructor
	//--------------------------------------------------------------------------
	CRedirect()
	 :	m_pEdit(NULL),
		m_bStopped(false)
	{
	}

	//--------------------------------------------------------------------------
	//	destructor
	//--------------------------------------------------------------------------
	virtual ~CRedirect();
	//--------------------------------------------------------------------------
	//	public member functions
	//--------------------------------------------------------------------------
	virtual void		Run(LPCTSTR szCommand, CEdit *pEdit, LPCTSTR pszCurrentDirectory = NULL);
	virtual	void		Stop();

protected:

	//--------------------------------------------------------------------------
	//	member functions
	//--------------------------------------------------------------------------
	virtual void WriteStdOut(LPCSTR pszOutput);
	virtual void WriteStdError(LPCSTR pszError);

	void				AppendText(LPCTSTR Text);
	void				PeekAndPump();

	//--------------------------------------------------------------------------
	//	member data
	//--------------------------------------------------------------------------
	CEdit *	m_pEdit;
	bool	m_bStopped;

};

#endif	// REDIRECT_H_INCLUDED__