[32] | 1 | #pragma once
|
---|
| 2 |
|
---|
| 3 |
|
---|
| 4 | class SAXContentHandlerImpl : public MSXML2::ISAXContentHandler
|
---|
| 5 | {
|
---|
| 6 | long m_RefCount;
|
---|
| 7 | public:
|
---|
| 8 | SAXContentHandlerImpl():m_RefCount(0) {}
|
---|
| 9 | virtual ~SAXContentHandlerImpl() {}
|
---|
| 10 |
|
---|
| 11 | long __stdcall QueryInterface(const struct _GUID &riid, void ** ppObj)
|
---|
| 12 | {
|
---|
| 13 | if (riid == IID_IUnknown)
|
---|
| 14 | {
|
---|
| 15 | *ppObj = static_cast<IUnknown*>(this);
|
---|
| 16 | }
|
---|
| 17 | if (riid == __uuidof(ISAXContentHandler))
|
---|
| 18 | {
|
---|
| 19 | *ppObj = static_cast<ISAXContentHandler*>(this);
|
---|
| 20 | }
|
---|
| 21 | else
|
---|
| 22 | {
|
---|
| 23 | *ppObj = NULL ;
|
---|
| 24 | return E_NOINTERFACE ;
|
---|
| 25 | }
|
---|
| 26 |
|
---|
| 27 | AddRef() ;
|
---|
| 28 | return S_OK;
|
---|
| 29 | }
|
---|
| 30 | unsigned long __stdcall AddRef(void)
|
---|
| 31 | {
|
---|
| 32 | return InterlockedIncrement(&m_RefCount);
|
---|
| 33 | }
|
---|
| 34 | unsigned long __stdcall Release(void)
|
---|
| 35 | {
|
---|
| 36 | long nRefCount=0;
|
---|
| 37 | nRefCount=InterlockedDecrement(&m_RefCount) ;
|
---|
| 38 | if (nRefCount == 0) delete this;
|
---|
| 39 | return nRefCount;
|
---|
| 40 | }
|
---|
| 41 |
|
---|
| 42 | virtual HRESULT STDMETHODCALLTYPE putDocumentLocator(
|
---|
| 43 | MSXML2::ISAXLocator __RPC_FAR *pLocator)
|
---|
| 44 | {return S_OK;}
|
---|
| 45 |
|
---|
| 46 | virtual HRESULT STDMETHODCALLTYPE startDocument( void)
|
---|
| 47 | {return S_OK;}
|
---|
| 48 |
|
---|
| 49 | virtual HRESULT STDMETHODCALLTYPE endDocument( void)
|
---|
| 50 | {return S_OK;}
|
---|
| 51 |
|
---|
| 52 | virtual HRESULT STDMETHODCALLTYPE startPrefixMapping(
|
---|
| 53 | wchar_t __RPC_FAR *pwchPrefix,
|
---|
| 54 | int cchPrefix,
|
---|
| 55 | wchar_t __RPC_FAR *pwchUri,
|
---|
| 56 | int cchUri)
|
---|
| 57 | {return S_OK;}
|
---|
| 58 |
|
---|
| 59 | virtual HRESULT STDMETHODCALLTYPE endPrefixMapping(
|
---|
| 60 | wchar_t __RPC_FAR *pwchPrefix,
|
---|
| 61 | int cchPrefix)
|
---|
| 62 | {return S_OK;}
|
---|
| 63 |
|
---|
| 64 | virtual HRESULT STDMETHODCALLTYPE startElement(
|
---|
| 65 | wchar_t __RPC_FAR *pwchNamespaceUri,
|
---|
| 66 | int cchNamespaceUri,
|
---|
| 67 | wchar_t __RPC_FAR *pwchLocalName,
|
---|
| 68 | int cchLocalName,
|
---|
| 69 | wchar_t __RPC_FAR *pwchRawName,
|
---|
| 70 | int cchRawName,
|
---|
| 71 | MSXML2::ISAXAttributes __RPC_FAR *pAttributes)
|
---|
| 72 | {return S_OK;}
|
---|
| 73 |
|
---|
| 74 | virtual HRESULT STDMETHODCALLTYPE endElement(
|
---|
| 75 | wchar_t __RPC_FAR *pwchNamespaceUri,
|
---|
| 76 | int cchNamespaceUri,
|
---|
| 77 | wchar_t __RPC_FAR *pwchLocalName,
|
---|
| 78 | int cchLocalName,
|
---|
| 79 | wchar_t __RPC_FAR *pwchRawName,
|
---|
| 80 | int cchRawName)
|
---|
| 81 | {return S_OK;}
|
---|
| 82 |
|
---|
| 83 | virtual HRESULT STDMETHODCALLTYPE characters(
|
---|
| 84 | wchar_t __RPC_FAR *pwchChars,
|
---|
| 85 | int cchChars)
|
---|
| 86 | {return S_OK;}
|
---|
| 87 |
|
---|
| 88 | virtual HRESULT STDMETHODCALLTYPE ignorableWhitespace(
|
---|
| 89 | wchar_t __RPC_FAR *pwchChars,
|
---|
| 90 | int cchChars)
|
---|
| 91 | {return S_OK;}
|
---|
| 92 |
|
---|
| 93 | virtual HRESULT STDMETHODCALLTYPE processingInstruction(
|
---|
| 94 | wchar_t __RPC_FAR *pwchTarget,
|
---|
| 95 | int cchTarget,
|
---|
| 96 | wchar_t __RPC_FAR *pwchData,
|
---|
| 97 | int cchData)
|
---|
| 98 | {return S_OK;}
|
---|
| 99 |
|
---|
| 100 | virtual HRESULT STDMETHODCALLTYPE skippedEntity(
|
---|
| 101 | wchar_t __RPC_FAR *pwchName,
|
---|
| 102 | int cchName)
|
---|
| 103 | {return S_OK;}
|
---|
| 104 | };
|
---|