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.

66 lines
1.2 KiB

  1. /*++
  2. Copyright (C) 1997-2001 Microsoft Corporation
  3. Module Name:
  4. COUT.H
  5. Abstract:
  6. Declares the COut class.
  7. History:
  8. a-davj 06-April-97 Created.
  9. --*/
  10. #ifndef __COUT__H_
  11. #define __COUT__H_
  12. #define INIT_SIZE 4096
  13. #define ADDITIONAL_SIZE 4096
  14. #include "trace.h"
  15. //***************************************************************************
  16. //
  17. // CLASS NAME:
  18. //
  19. // COut
  20. //
  21. // DESCRIPTION:
  22. //
  23. // Provides an automatically resizing buffer for ouput. Writting is done
  24. // to offsets and the buffer also writes itself to a file.
  25. //
  26. //***************************************************************************
  27. #include <flexarry.h>
  28. class COut {
  29. public:
  30. COut(PDBG pDbg);
  31. ~COut();
  32. BOOL WriteToFile(LPSTR pFile);
  33. DWORD WriteBytes(DWORD dwOffset, BYTE * pSrc, DWORD dwSize);
  34. DWORD AppendBytes(BYTE * pSrc, DWORD dwSize);
  35. DWORD WriteBSTR(BSTR bstr);
  36. DWORD GetOffset(void){return m_dwCurr;};
  37. BOOL AddFlavor(long lFlavor);
  38. void SetPadMode(BOOL bPad){m_bPadString = bPad;};
  39. private:
  40. PDBG m_pDbg;
  41. BYTE * m_pMem;
  42. DWORD m_dwSize;
  43. DWORD m_dwCurr;
  44. CFlexArray m_Offsets;
  45. CFlexArray m_Flavors;
  46. BOOL m_bPadString;
  47. };
  48. #endif