m_Value -> base pointer

This commit is contained in:
Glenn Maynard
2006-10-06 06:38:46 +00:00
parent 6808723b85
commit ba82cc8002
3 changed files with 43 additions and 21 deletions
+21 -4
View File
@@ -13,10 +13,21 @@
#include "DateTime.h"
#include "Foreach.h"
XNode::XNode( const XNode &cpy ):
m_sName( cpy.m_sName ),
m_Value( cpy.m_Value )
XNode::XNode()
{
m_pValue = new XNodeStringValue;
}
XNode::XNode( const RString &sName )
{
m_sName = sName;
m_pValue = new XNodeStringValue;
}
XNode::XNode( const XNode &cpy ):
m_sName( cpy.m_sName )
{
m_pValue = cpy.m_pValue->Copy();
FOREACH_CONST_Attr( &cpy, pAttr )
this->AppendAttr( pAttr->first, pAttr->second->Copy() );
FOREACH_CONST_Child( &cpy, c )
@@ -25,10 +36,16 @@ XNode::XNode( const XNode &cpy ):
XNode::~XNode()
{
Clear();
Free();
}
void XNode::Clear()
{
Free();
m_pValue = new XNodeStringValue;
}
void XNode::Free()
{
FOREACH_Child( this, p )
SAFE_DELETE( p );