Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #include "redir.h"
  9. #ifndef REDIRECT_H_INCLUDED__
  10. #define REDIRECT_H_INCLUDED__
  11. class CRedirect : public CRedirector
  12. {
  13. public:
  14. //--------------------------------------------------------------------------
  15. // constructor
  16. //--------------------------------------------------------------------------
  17. CRedirect()
  18. : m_pEdit(NULL),
  19. m_bStopped(false)
  20. {
  21. }
  22. //--------------------------------------------------------------------------
  23. // destructor
  24. //--------------------------------------------------------------------------
  25. virtual ~CRedirect();
  26. //--------------------------------------------------------------------------
  27. // public member functions
  28. //--------------------------------------------------------------------------
  29. virtual void Run(LPCTSTR szCommand, CEdit *pEdit, LPCTSTR pszCurrentDirectory = NULL);
  30. virtual void Stop();
  31. protected:
  32. //--------------------------------------------------------------------------
  33. // member functions
  34. //--------------------------------------------------------------------------
  35. virtual void WriteStdOut(LPCSTR pszOutput);
  36. virtual void WriteStdError(LPCSTR pszError);
  37. void AppendText(LPCTSTR Text);
  38. void PeekAndPump();
  39. //--------------------------------------------------------------------------
  40. // member data
  41. //--------------------------------------------------------------------------
  42. CEdit * m_pEdit;
  43. bool m_bStopped;
  44. };
  45. #endif // REDIRECT_H_INCLUDED__