SAXContentHandlerImpl.cpp
资源名称:xml_Vc.zip [点击查看]
上传用户:quanyou
上传日期:2022-06-07
资源大小:39k
文件大小:4k
源码类别:
xml/soap/webservice
开发平台:
Visual C++
- // SAXContentHandlerImpl.cpp: implementation class for ISAXDeclHandler interface
- #include "stdafx.h"
- #include "SAXContentHandlerImpl.h"
- ///////////////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- ///////////////////////////////////////////////////////////////////////////////
- SAXContentHandlerImpl::SAXContentHandlerImpl()
- {
- m_refCnt=0;
- }
- SAXContentHandlerImpl::~SAXContentHandlerImpl()
- {
- }
- HRESULT STDMETHODCALLTYPE SAXContentHandlerImpl::putDocumentLocator(
- /* [in] */ ISAXLocator __RPC_FAR *pLocator
- )
- {
- return S_OK;
- }
- HRESULT STDMETHODCALLTYPE SAXContentHandlerImpl::startDocument()
- {
- return S_OK;
- }
- HRESULT STDMETHODCALLTYPE SAXContentHandlerImpl::endDocument( void)
- {
- return S_OK;
- }
- HRESULT STDMETHODCALLTYPE SAXContentHandlerImpl::startPrefixMapping(
- /* [in] */ wchar_t __RPC_FAR *pwchPrefix,
- /* [in] */ int cchPrefix,
- /* [in] */ wchar_t __RPC_FAR *pwchUri,
- /* [in] */ int cchUri)
- {
- return S_OK;
- }
- HRESULT STDMETHODCALLTYPE SAXContentHandlerImpl::endPrefixMapping(
- /* [in] */ wchar_t __RPC_FAR *pwchPrefix,
- /* [in] */ int cchPrefix)
- {
- return S_OK;
- }
- HRESULT STDMETHODCALLTYPE SAXContentHandlerImpl::startElement(
- /* [in] */ wchar_t __RPC_FAR *pwchNamespaceUri,
- /* [in] */ int cchNamespaceUri,
- /* [in] */ wchar_t __RPC_FAR *pwchLocalName,
- /* [in] */ int cchLocalName,
- /* [in] */ wchar_t __RPC_FAR *pwchRawName,
- /* [in] */ int cchRawName,
- /* [in] */ ISAXAttributes __RPC_FAR *pAttributes)
- {
- return S_OK;
- }
- HRESULT STDMETHODCALLTYPE SAXContentHandlerImpl::endElement(
- /* [in] */ wchar_t __RPC_FAR *pwchNamespaceUri,
- /* [in] */ int cchNamespaceUri,
- /* [in] */ wchar_t __RPC_FAR *pwchLocalName,
- /* [in] */ int cchLocalName,
- /* [in] */ wchar_t __RPC_FAR *pwchRawName,
- /* [in] */ int cchRawName)
- {
- return S_OK;
- }
- HRESULT STDMETHODCALLTYPE SAXContentHandlerImpl::characters(
- /* [in] */ wchar_t __RPC_FAR *pwchChars,
- /* [in] */ int cchChars)
- {
- return S_OK;
- }
- HRESULT STDMETHODCALLTYPE SAXContentHandlerImpl::ignorableWhitespace(
- /* [in] */ wchar_t __RPC_FAR *pwchChars,
- /* [in] */ int cchChars)
- {
- return S_OK;
- }
- HRESULT STDMETHODCALLTYPE SAXContentHandlerImpl::processingInstruction(
- /* [in] */ wchar_t __RPC_FAR *pwchTarget,
- /* [in] */ int cchTarget,
- /* [in] */ wchar_t __RPC_FAR *pwchData,
- /* [in] */ int cchData)
- {
- return S_OK;
- }
- HRESULT STDMETHODCALLTYPE SAXContentHandlerImpl::skippedEntity(
- /* [in] */ wchar_t __RPC_FAR *pwchVal,
- /* [in] */ int cchVal)
- {
- return S_OK;
- }
- long __stdcall SAXContentHandlerImpl::QueryInterface(const struct _GUID &riid,void ** ppvObject)
- {
- *ppvObject = NULL;
- if (riid == IID_IUnknown ||riid == __uuidof(ISAXContentHandler))
- {
- *ppvObject = static_cast<ISAXContentHandler *>(this);
- }
- if (*ppvObject)
- {
- AddRef();
- return S_OK;
- }
- else return E_NOINTERFACE;
- }
- unsigned long __stdcall SAXContentHandlerImpl::AddRef()
- {
- return ++m_refCnt; // NOT thread-safe
- }
- unsigned long __stdcall SAXContentHandlerImpl::Release()
- {
- --m_refCnt; // NOT thread-safe
- if (m_refCnt == 0) {
- delete this;
- return 0; // Can't return the member of a deleted object.
- }
- else return m_refCnt;
- }