Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
namespaces.h
#ifndef CNAMESPACES_H__
#define CNAMESPACES_H__ 1
#include "p6loader.h"
#include "p6xmlcompile.h"
namespace P6EXAMPLES {
// -> an array of these is a simple implementation
typedef struct
{
P6R::P6CHAR *pPrefix;
P6R::P6UINT32 prefixLength;
P6R::P6CHAR *pURI;
P6R::P6UINT32 uriLength;
} prefixToURL_t;
//
// This defines a private interface that will be used
// to initalize our console stream. 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 p6IDataStream
// interface.
//
interface INamespacesInit : public P6R::p6ICom
{
P6COMMETHOD initialize( P6R::P6UINT32 mapSize ) = 0;
P6COMMETHOD defineNamespace( const P6R::P6CHAR *pPrefix, P6R::P6UINT32 prefixLength, const P6R::P6CHAR *pURI, P6R::P6UINT32 uriLength ) = 0;
};
// {344ADDCE-CD76-4F54-A697-53CB53341B36}
#define IF_INamespacesInit {0x344ADDCE,0xCD76,0x4F54,{0xA6,0x97,0x53,0xCB,0x53,0x34,0x1B,0x36}}
class CNamespaces : public INamespacesInit, public P6R::p6IXMLCompile
{
public:
//
// P6COM Helper macro declares p6ICom methods
// - queryInterface()
// - addref()
// - release()
// - createInstance() <- This is a static method
// used to create an instance
// of this component.
//
//
// INamespaceInit methods
//
P6COMMETHOD initialize( P6R::P6UINT32 mapSize );
P6COMMETHOD defineNamespace( const P6R::P6CHAR *pPrefix, P6R::P6UINT32 prefixLength, const P6R::P6CHAR *pURI, P6R::P6UINT32 uriLength );
//
// p6IXMLCompile methods
//
P6COMMETHOD nameSpaceInScope( const P6R::P6CHAR *pPrefix, P6R::P6UINT32 prefixLength, P6R::P6CHAR *pURI, P6R::P6UINT32 *pLength );
CNamespaces();
virtual ~CNamespaces();
protected:
P6R::P6BOOL m_bInitialized;
prefixToURL_t *m_pMapping;
P6R::P6UINT32 m_mapSize;
P6R::P6UINT32 m_nextIndex;
};
} // namespace
#endif