enumXmlFile.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef NULLSOFT_WINAMP_ENUMERATOR_XML_HEADER
  2. #define NULLSOFT_WINAMP_ENUMERATOR_XML_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 EnumXmlFile : public MultiPatch<MPIID_OMSERVICEENUM, ifc_omserviceenum>,
  15. public MultiPatch<MPIID_OMXMLSERVICEENUM, ifc_omxmlserviceenum>
  16. {
  17. protected:
  18. EnumXmlFile(HANDLE xmlHandle, obj_xml *xmlReader, LPCWSTR pszAddress, ifc_omservicehost *serviceHost);
  19. ~EnumXmlFile();
  20. public:
  21. static HRESULT CreateInstance(LPCWSTR pszAddress, ifc_omservicehost *host, EnumXmlFile **instance);
  22. static HRESULT CheckXmlHeader(HANDLE hFile);
  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. RECVS_MULTIPATCH;
  37. protected:
  38. ULONG ref;
  39. LPWSTR address;
  40. HANDLE hFile;
  41. obj_xml *reader;
  42. INT readerError;
  43. XmlResponseParser parser;
  44. BYTE *buffer;
  45. UINT bufferMax;
  46. };
  47. #endif //NULLSOFT_WINAMP_ENUMERATOR_XML_HEADER