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.

58 lines
1.6 KiB

  1. /*
  2. * p l a i n c n v . h
  3. *
  4. * Purpose:
  5. * Plain Stream -> html converter
  6. *
  7. * History
  8. * September '96: brettm - created
  9. *
  10. * Copyright (C) Microsoft Corp. 1995, 1996.
  11. */
  12. #ifndef _PLAINCONV_H
  13. #define _PLAINCONV_H
  14. #define CCHMAX_BUFFER 8192
  15. class CPlainConverter
  16. {
  17. public:
  18. // *** IUnknown methods ***
  19. HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, LPVOID FAR *);
  20. ULONG STDMETHODCALLTYPE AddRef();
  21. ULONG STDMETHODCALLTYPE Release();
  22. CPlainConverter();
  23. ~CPlainConverter();
  24. HRESULT HrConvert(LPSTREAM pstmPlain, WCHAR chQuoteW, LPSTREAM *ppstmHtml);
  25. private:
  26. ULONG m_cRef;
  27. LPSTREAM m_pstmPlain,
  28. m_pstmOut;
  29. ULONG m_cchOut,
  30. m_cchBuffer,
  31. m_cchPos,
  32. m_nSpcs;
  33. BOOL m_fCRLF;
  34. WCHAR m_rgchOutBufferW[CCHMAX_BUFFER];
  35. WCHAR m_rgchBufferW[CCHMAX_BUFFER],
  36. m_chQuoteW;
  37. HRESULT HrParseStream();
  38. HRESULT HrWrite(LPCWSTR pszW, ULONG cch);
  39. HRESULT HrOutputSpaces(ULONG cSpaces);
  40. inline HRESULT HrOutputQuoteChar();
  41. };
  42. typedef CPlainConverter *LPPLAINCONVERTER;
  43. HRESULT HrConvertPlainStreamW(LPSTREAM pstm, WCHAR chQuote, LPSTREAM *ppstmHtml);
  44. HRESULT HrConvertHTMLToFormat(LPSTREAM pstmHtml, LPSTREAM *ppstm, CLIPFORMAT cf);
  45. HRESULT EscapeStringToHTML(LPWSTR pwszIn, LPWSTR *ppwszOut);
  46. #endif //_PLAINCONV_H