Leaked source code of windows server 2003
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.

70 lines
1.7 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name :
  4. OutStrm.h
  5. Abstract:
  6. A lightweight interface of output streams. This class provides
  7. the interface, as well as a basic skeleton for output streams.
  8. Author:
  9. Neil Allain ( a-neilal ) August-1997
  10. Revision History:
  11. --*/
  12. #pragma once
  13. #include "MyString.h"
  14. struct OutToken
  15. {
  16. LONG val;
  17. };
  18. struct EndLineToken : public OutToken
  19. {
  20. };
  21. extern EndLineToken endl;
  22. class OutStream
  23. {
  24. public:
  25. OutStream();
  26. virtual ~OutStream();
  27. HRESULT lastError() const { return m_lastError; }
  28. virtual HRESULT writeChar( _TCHAR )=0;
  29. virtual HRESULT writeString( LPCTSTR, size_t )=0;
  30. virtual HRESULT writeString( LPCTSTR );
  31. virtual HRESULT writeString( const String& );
  32. virtual HRESULT writeLine( LPCTSTR, ... );
  33. virtual HRESULT writeInt16( SHORT );
  34. virtual HRESULT writeInt( int );
  35. virtual HRESULT writeInt32( LONG );
  36. virtual HRESULT writeFloat( float );
  37. virtual HRESULT writeDouble( double );
  38. virtual HRESULT writeToken( const OutToken& );
  39. virtual HRESULT writeEolToken( const EndLineToken& );
  40. virtual HRESULT flush();
  41. OutStream& operator<<( _TCHAR );
  42. OutStream& operator<<( SHORT );
  43. OutStream& operator<<( int );
  44. OutStream& operator<<( LONG );
  45. OutStream& operator<<( float );
  46. OutStream& operator<<( double );
  47. OutStream& operator<<( const String& );
  48. OutStream& operator<<( LPCTSTR );
  49. OutStream& operator<<( const OutToken& );
  50. OutStream& operator<<( const EndLineToken& );
  51. protected:
  52. void setLastError( HRESULT );
  53. private:
  54. HRESULT m_lastError;
  55. };