aboutsummaryrefslogtreecommitdiff
path: root/Src/omBrowser/xmlResponseParser.h
diff options
context:
space:
mode:
authorJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
committerJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
commit20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/omBrowser/xmlResponseParser.h
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/omBrowser/xmlResponseParser.h')
-rw-r--r--Src/omBrowser/xmlResponseParser.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/Src/omBrowser/xmlResponseParser.h b/Src/omBrowser/xmlResponseParser.h
new file mode 100644
index 00000000..d73e2857
--- /dev/null
+++ b/Src/omBrowser/xmlResponseParser.h
@@ -0,0 +1,56 @@
+#ifndef NULLSOFT_WINAMP_XML_RESPONSE_PARSER_HEADER
+#define NULLSOFT_WINAMP_XML_RESPONSE_PARSER_HEADER
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#pragma once
+#endif
+
+#include <wtypes.h>
+#include "../xml/ifc_xmlreadercallback.h"
+#include "./xmlServiceParser.h"
+#include "./stringBuilder.h"
+#include <deque>
+
+class obj_xml;
+class ifc_omservicehost;
+class ifc_omstorage;
+
+class XmlResponseParser : public ifc_xmlreadercallback
+{
+public:
+ XmlResponseParser();
+ ~XmlResponseParser();
+
+public:
+ HRESULT Initialize(obj_xml *xml, ifc_omservicehost *serviceHost);
+ HRESULT Finish();
+ HRESULT Reset();
+
+ HRESULT GetCode(UINT *value);
+ HRESULT GetText(LPWSTR pszBuffer, UINT cchBufferMax);
+
+ HRESULT PeekService(ifc_omservice **service);
+
+protected:
+ void OnStartElement(const wchar_t *xmlpath, const wchar_t *xmltag, ifc_xmlreaderparams *params);
+ void OnEndElement(const wchar_t *xmlpath, const wchar_t *xmltag);
+ void OnCharData(const wchar_t *xmlpath, const wchar_t *xmltag, const wchar_t *str);
+ void OnError(int linenum, int errcode, const wchar_t *errstr);
+
+protected:
+ typedef std::deque<ifc_omservice*> ServiceDeque;
+
+protected:
+ obj_xml *reader;
+ UINT code;
+ LPWSTR text;
+
+ XmlServiceParser parser;
+ ifc_omservicehost *host;
+ ServiceDeque deque;
+ StringBuilder string;
+protected:
+ RECVS_DISPATCH;
+
+};
+#endif// NULLSOFT_WINAMP_XML_RESPONSE_PARSER_HEADER \ No newline at end of file