Source code of Windows XP (NT5)
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.

38 lines
1.1 KiB

  1. // BinHex.h: interface for the CBinHex class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_BINHEX_H__1B7F2A63_8878_11D2_B4C8_00C04F9914AB__INCLUDED_)
  5. #define AFX_BINHEX_H__1B7F2A63_8878_11D2_B4C8_00C04F9914AB__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #include <wtypes.h>
  10. #include <oleauto.h>
  11. #define BBAD (BYTE)-1
  12. class CBinHex
  13. {
  14. public:
  15. CBinHex();
  16. // Prepend makes this a non-generic binhex, but oh well.
  17. // If it's 0, nothing is prepended
  18. static HRESULT ToBase64(LPVOID pv, UINT cbSize, char prepend, char ivecnpad[9], BSTR* pbstr);
  19. static HRESULT ToBase64ASCII(LPVOID pv, UINT cbSize, char prepend, char ivecnpad[9], BSTR* pbstr);
  20. HRESULT FromBase64(LPSTR lpStr, UINT cbSize, BSTR* pblob);
  21. HRESULT FromWideBase64(BSTR bstr, BSTR* pblob);
  22. HRESULT PartFromBase64(LPSTR lpStr, BYTE* output, ULONG *numOutBytes);
  23. HRESULT PartFromWideBase64(LPWSTR bStr, BYTE* output, ULONG *numOutBytes);
  24. protected:
  25. BYTE m_decodeArray[256];
  26. };
  27. #endif // !defined(AFX_BINHEX_H__1B7F2A63_8878_11D2_B4C8_00C04F9914AB__INCLUDED_)