enumXmlBuffer.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef NULLSOFT_WINAMP_ENUMERATOR_XML_BUFFER_HEADER
  2. #define NULLSOFT_WINAMP_ENUMERATOR_XML_BUFFER_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include "./ifc_omserviceenum.h"
  7. #include "./ifc_omxmlserviceenum.h"
  8. #include "./xmlResponseParser.h"
  9. #include <bfc/multipatch.h>
  10. class ifc_omservicehost;
  11. class obj_xml;
  12. #define MPIID_OMSERVICEENUM 10
  13. #define MPIID_OMXMLSERVICEENUM 20
  14. class EnumXmlBuffer : public MultiPatch<MPIID_OMSERVICEENUM, ifc_omserviceenum>,
  15. public MultiPatch<MPIID_OMXMLSERVICEENUM, ifc_omxmlserviceenum>
  16. {
  17. protected:
  18. EnumXmlBuffer(obj_xml *xmlReader, const void *buffer, size_t bufferSize, Dispatchable *bufferOwner, ifc_omservicehost *serviceHost);
  19. ~EnumXmlBuffer();
  20. public:
  21. static HRESULT CreateInstance(const void *buffer, size_t bufferSize, Dispatchable *bufferOwner, ifc_omservicehost *host, EnumXmlBuffer **instance);
  22. static HRESULT CheckXmlHeader(const void *buffer, size_t bufferSize);
  23. public:
  24. /* Dispatchable */
  25. size_t AddRef();
  26. size_t Release();
  27. int QueryInterface(GUID interface_guid, void **object);
  28. /* ifc_omserviceenum */
  29. HRESULT Next(ULONG listSize, ifc_omservice **elementList, ULONG *elementCount);
  30. HRESULT Reset(void);
  31. HRESULT Skip(ULONG elementCount);
  32. /* ifc_omxmlserviceenum */
  33. HRESULT GetStatusCode(UINT *code);
  34. HRESULT GetStatusText(LPWSTR pszBuffer, UINT cchBufferMax);
  35. protected:
  36. ULONG ref;
  37. const void *buffer;
  38. size_t bufferSize;
  39. size_t cursor;
  40. obj_xml *reader;
  41. INT readerError;
  42. XmlResponseParser parser;
  43. Dispatchable *bufferOwner;
  44. protected:
  45. RECVS_MULTIPATCH;
  46. };
  47. #endif //NULLSOFT_WINAMP_ENUMERATOR_XML_BUFFER_HEADER