You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by anand awasthi <on...@yahoo.com> on 2001/06/12 16:28:18 UTC

wrapping Xerces API in my code !!

Hi,

I am trying to wrap Xerces API in my code in following
manner :


oni.h 
----------

struct Xml_DOM_Node_Impl;
struct Xml_DOM_Node_Impl
{
    DOM_Node domnode;
};

class Xml_DOM_Node 
{
public:	
	Xml_DOM_Node(Xml_DOM_Node_Impl*);	
	~Xml_DOM_Node();	
	DOMString getNodeName() const;	
	Xml_DOM_Node getParentNode() const;
private:
    Xml_DOM_Node_Impl* pdomnodeimpl; 
};


-------------------------------------------

oni.cpp
---------

#include "oni.h"
#include <xercesheaders>


Xml_DOM_Node::Xml_DOM_Node(Xml_DOM_Node_Impl* impl) :
pdomnodeimpl(impl)
{
}

DOMString Xml_DOM_Node::getNodeName() const 
{
 return (pdomnodeimpl->domnode.getNodeName());
}

Xml_DOM_Node Xml_DOM_Node::getParentNode() const 
{
 DOM_Node node =
pdomnodeimpl->domnode.getParentNode();
 pdomnodeimpl->domnode = node; 
 return Xml_DOM_Node(pdomnodeimpl);
}

Xml_DOM_Node::~Xml_DOM_Node()
{
delete pdomnodeimpl;
}

could C++/Xerces gurus pls tell me that above code is
correct or not ?? if notr then pls suggest me better
ways.

i would really appreciate that.

thanks

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org