isapimix.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10. #include "stdafx.h"
  11. #include <afxisapi.h>
  12. CHttpServerContext& CHttpServerContext::operator<<(const CLongBinary& blob)
  13. {
  14. ISAPIASSERT(m_pStream != NULL);
  15. if (m_pStream != NULL) *m_pStream << blob;
  16. return *this;
  17. }
  18. CHttpServerContext& CHttpServerContext::operator<<(const CByteArray& array)
  19. {
  20. ISAPIASSERT(m_pStream != NULL);
  21. if (m_pStream != NULL) *m_pStream << array;
  22. return *this;
  23. }
  24. CHtmlStream& CHtmlStream::operator<<(const CByteArray& array)
  25. {
  26. int nSize = array.GetSize();
  27. if (nSize > 0)
  28. {
  29. const BYTE* pStart = array.GetData();
  30. if (pStart != NULL)
  31. Write(pStart, nSize);
  32. }
  33. return *this;
  34. }
  35. CHtmlStream& CHtmlStream::operator<<(const CLongBinary& blob)
  36. {
  37. if (blob.m_dwDataLength > 0 && blob.m_hData != NULL)
  38. {
  39. LPVOID lpData = GlobalLock(blob.m_hData);
  40. if (lpData != NULL)
  41. {
  42. Write(lpData, blob.m_dwDataLength);
  43. GlobalUnlock(blob.m_hData);
  44. }
  45. }
  46. return *this;
  47. }