SOL9 2.0 Class: SAXDTDHandlerImpl

 SOL9 C++ Class Library  SOL9 Samples  SOL9 Tutorial  SOL9 FAQ  SOL9 ClassTree 

Source code

/*
 * SAXDTDHandlerImpl.h 
 * Copyright (c) 2011 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */


// SOL9
// 2011/01/27
#pragma once

#include <sol/xml/XMLObject.h>
#include <sol/WString.h>

//Implementation class ISAXDTDHandler COM interface.
//But, this is used to be a C++ class not COM object.
//Therefore we create an instance of this class by ordinary C++ constructor,
// not using ::CoCreateInstance API.

namespace SOL {

class SAXDTDHandlerImpl : public ISAXDTDHandler
{
public:
    SAXDTDHandlerImpl()
    {
    }

private:
    long __stdcall QueryInterface(const struct _GUID & riid, void **ppObject)     
    {
        return S_OK;
    }

    unsigned long __stdcall AddRef(void) 
    { 
        return 0;
    }

    unsigned long __stdcall Release(void) 
    { 
        return 0;
    }


private:
    virtual HRESULT __stdcall raw_notationDecl(
        __in  unsigned short * pwchName,
        __in int cchName,
        __in unsigned short * pwchPublicId,
        __in int cchPublicId,
        __in unsigned short * pwchSystemId,
        __in int cchSystemId)
    {
        WString wname(pwchName, cchName);
        WString wpublicId(pwchPublicId, cchPublicId);
        WString wsystemId(pwchSystemId, cchSystemId);

        notationDecl(
            _bstr_t((const wchar_t*)wname),
            _bstr_t((const wchar_t*)wpublicId),
            _bstr_t((const wchar_t*)wsystemId));

        return S_OK;
    }

    virtual HRESULT __stdcall raw_unparsedEntityDecl(
        __in unsigned short * pwchName,
        __in int cchName,
        __in unsigned short * pwchPublicId,
        __in int cchPublicId,
        __in unsigned short * pwchSystemId,
        __in int cchSystemId,
        __in unsigned short * pwchNotationName,
        __in int cchNotationName)
    {
        WString wname(pwchName, cchName);
        WString wpublicId(pwchPublicId, cchPublicId);
        WString wsystemId(pwchSystemId, cchSystemId);
        WString wnotationName(pwchNotationName, cchNotationName);

        unparsedEntityDecl(
            _bstr_t((const wchar_t*)wname),
            _bstr_t((const wchar_t*)wpublicId),
            _bstr_t((const wchar_t*)wsystemId),
            _bstr_t((const wchar_t*)wnotationName));
        return S_OK;
    }


public:
    virtual void notationDecl(
        __in const _bstr_t name,
        __in const _bstr_t publicId,
        __in const _bstr_t systemId)
    {
    }

public:
    virtual void unparsedEntityDecl(
        __in const _bstr_t name,
        __in const _bstr_t publicId,
        __in const _bstr_t systemId,
        __in const _bstr_t notationName)
    {
    }
};

}

Last modified: 1 Feb 2012

Copyright (c) 2009-2012 Antillia.com ALL RIGHTS RESERVED.