Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ccontenthandler.h
#ifndef CCONTENTHANDLER_H__
#define CCONTENTHANDLER_H__ 1
#include "p6loader.h"
namespace P6EXAMPLES {
//
// This defines a private interface that will be used
// to initalize our content handler. The createInstance()
// method returns only interface pointers and this
// allows us to ask it for this interface. Once
// initialize() has been successfully called,
// queryInterface() is used to retrieve the
// p6IJSONContentHandler interface.
//
interface IContentHandlerInit : public P6R::p6ICom
{
P6COMMETHOD initialize( P6R::p6IConsole *pConsole, P6R::p6ISafeString* pStr ) = 0;
};
// {87B1D62F-70D7-43F0-B5E9-639D57AA1621}
#define IF_IContentHandlerInit {0x87B1D62F,0x70D7,0x43F0,{0xB5,0xE9,0x63,0x9D,0x57,0xAA,0x16,0x21}}
//
class CContentHandler : public IContentHandlerInit, public P6R::p6IJSONContentHandler
{
public:
//
// P6COM Helper macro declares p6ICom methods
// - queryInterface()
// - addref()
// - release()
// - createInstance() <- This is a static method
// used to create an instance
// of this component.
//
//
// IContentHandlerInit methods
//
P6COMMETHOD initialize( P6R::p6IConsole *pConsole, P6R::p6ISafeString* pStr );
//
// p6IJSONContentHandler methods
//
P6COMMETHOD endDocument();
P6COMMETHOD endObject( P6R::P6UINT32 nestingLevel );
P6COMMETHOD endArray( P6R::P6UINT32 nestingLevel );
P6COMMETHOD setDocumentLocator( P6R::p6IJSONLocator* pObject );
P6COMMETHOD startDocument();
P6COMMETHOD startObject( P6R::P6UINT32 nestingLevel );
P6COMMETHOD startPair( P6R::P6JSONSTRING* pName );
P6COMMETHOD startArray( P6R::P6UINT32 nestingLevel );
P6COMMETHOD value( P6R::P6JSONVALUE* pValue );
CContentHandler();
virtual ~CContentHandler();
protected:
P6R::P6BOOL m_bInitialized; // -> don't allow any operation until properly initialized
P6R::p6ComPtr<P6R::p6IConsole> m_cpConsole; // ->
P6R::p6ComPtr<P6R::p6IJSONLocator> m_cpLoc; // -> untility object
P6R::P6UINT32 m_startPair; // -> counters to help match returned cases
P6R::P6UINT32 m_value; // ->
P6R::P6UINT32 m_startObj; // ->
P6R::P6UINT32 m_startArray; // ->
};
}// namespace
#endif