| 38 | } |
| 39 | |
| 40 | class SimpleSAXContentHandler : public ISAXContentHandler |
| 41 | { |
| 42 | private: |
| 43 | ULONG m_refCount = 1; |
| 44 | public: |
| 45 | virtual ~SimpleSAXContentHandler() = default; |
| 46 | |
| 47 | HRESULT STDMETHODCALLTYPE QueryInterface(const IID& riid, void** ppvObject) override |
| 48 | { |
| 49 | if (ppvObject == nullptr) |
| 50 | return E_INVALIDARG; |
| 51 | if (riid == IID_IUnknown) |
| 52 | { |
| 53 | *ppvObject = static_cast<IUnknown*>(this); |
| 54 | } |
| 55 | else if (riid == IID_ISAXContentHandler) |
| 56 | { |
| 57 | *ppvObject = static_cast<ISAXContentHandler*>(this); |
| 58 | } |
| 59 | else |
| 60 | { |
| 61 | return E_NOINTERFACE; |
| 62 | } |
| 63 | return S_OK; |
| 64 | } |
| 65 | |
| 66 | ULONG STDMETHODCALLTYPE AddRef() override |
| 67 | { |
| 68 | return ++m_refCount; |
| 69 | } |
| 70 | |
| 71 | ULONG STDMETHODCALLTYPE Release() override |
| 72 | { |
| 73 | ULONG refCount = --m_refCount; |
| 74 | if (refCount == 0) |
| 75 | delete this; |
| 76 | return refCount; |
| 77 | } |
| 78 | |
| 79 | HRESULT STDMETHODCALLTYPE putDocumentLocator(ISAXLocator* pLocator) override |
| 80 | { |
| 81 | return S_OK; |
| 82 | } |
| 83 | |
| 84 | HRESULT STDMETHODCALLTYPE startDocument() override |
| 85 | { |
| 86 | return S_OK; |
| 87 | } |
| 88 | |
| 89 | HRESULT STDMETHODCALLTYPE endDocument() override |
| 90 | { |
| 91 | return S_OK; |
| 92 | } |
| 93 | |
| 94 | HRESULT STDMETHODCALLTYPE startPrefixMapping(const wchar_t* pwchPrefix, int cchPrefix, const wchar_t* pwchUri, |
| 95 | int cchUri) override |
| 96 | { |
| 97 | return S_OK; |
nothing calls this directly
no outgoing calls
no test coverage detected