WSMessageStreamExporter.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright 2005 - 2016 Zarafa and its licensors
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU Affero General Public License, version 3,
  6. * as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU Affero General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Affero General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. *
  16. */
  17. #ifndef WSMessageStreamExporter_INCLUDED
  18. #define WSMessageStreamExporter_INCLUDED
  19. #include <kopano/zcdefs.h>
  20. #include <kopano/memory.hpp>
  21. #include <kopano/ECUnknown.h>
  22. #include "soapStub.h"
  23. #include <string>
  24. #include <map>
  25. class WSTransport;
  26. class WSSerializedMessage;
  27. /**
  28. * This object encapsulates a set of exported streams. It allows the user to request each individual stream. The
  29. * streams must be requested in the correct sequence.
  30. */
  31. class WSMessageStreamExporter _kc_final : public ECUnknown {
  32. public:
  33. static HRESULT Create(ULONG ulOffset, ULONG ulCount, const messageStreamArray &streams, WSTransport *lpTransport, WSMessageStreamExporter **lppStreamExporter);
  34. bool IsDone() const;
  35. HRESULT GetSerializedMessage(ULONG ulIndex, WSSerializedMessage **lppSerializedMessage);
  36. private:
  37. WSMessageStreamExporter(void) = default;
  38. ~WSMessageStreamExporter();
  39. // Inhibit copying
  40. WSMessageStreamExporter(const WSMessageStreamExporter &) = delete;
  41. WSMessageStreamExporter &operator=(const WSMessageStreamExporter &) = delete;
  42. typedef KCHL::object_ptr<WSTransport> WSTransportPtr;
  43. struct StreamInfo {
  44. std::string id;
  45. unsigned long cbPropVals;
  46. SPropArrayPtr ptrPropVals;
  47. };
  48. typedef std::map<ULONG, StreamInfo*> StreamInfoMap;
  49. ULONG m_ulExpectedIndex = 0, m_ulMaxIndex = 0;
  50. WSTransportPtr m_ptrTransport;
  51. StreamInfoMap m_mapStreamInfo;
  52. };
  53. typedef KCHL::object_ptr<WSMessageStreamExporter> WSMessageStreamExporterPtr;
  54. #endif // ndef ECMessageStreamExporter_INCLUDED