//--------------------------------------------------------- void CSG_MetaData::_Load(wxXmlNode *pNode) { Set_Name (SG_UTF8_To_String(pNode->GetName ()).c_str()); Set_Content (SG_UTF8_To_String(pNode->GetNodeContent()).c_str()); //----------------------------------------------------- wxXmlProperty *pProperty = pNode->GetProperties(); while( pProperty ) { Add_Property(SG_UTF8_To_String(pProperty->GetName()).c_str(), SG_UTF8_To_String(pProperty->GetValue()).c_str()); pProperty = pProperty->GetNext(); } //----------------------------------------------------- wxXmlNode *pChild = pNode->GetChildren(); while( pChild ) { if( pChild->GetType() != wxXML_TEXT_NODE ) { Add_Child()->_Load(pChild); } pChild = pChild->GetNext(); } }
//--------------------------------------------------------- bool CSG_MetaData::Assign(const CSG_MetaData &MetaData, bool bAppend) { int i; if( !bAppend ) { Destroy(); Set_Name (MetaData.Get_Name ()); Set_Content (MetaData.Get_Content()); //------------------------------------------------- for(i=0; i<MetaData.Get_Property_Count(); i++) { Add_Property(MetaData.Get_Property_Name(i), MetaData.Get_Property(i)); } } //----------------------------------------------------- for(i=0; i<MetaData.Get_Children_Count(); i++) { Add_Child()->Assign(*MetaData.Get_Child(i), false); } return( true ); }
//--------------------------------------------------------- bool CSG_MetaData::Assign(const CSG_MetaData &MetaData, bool bAddChildren) { if( &MetaData != this ) { Destroy(); Set_Name (MetaData.Get_Name ()); Set_Content (MetaData.Get_Content()); for(int i=0; i<MetaData.Get_Property_Count(); i++) { Add_Property(MetaData.Get_Property_Name(i), MetaData.Get_Property(i)); } if( bAddChildren ) { Add_Children(MetaData); } } return( true ); }