Exemple #1
0
void TTiXmlDocument::CopyTo( TTiXmlDocument* target ) const
{
	TTiXmlNode::CopyTo( target );

	target->error = error;
	target->errorDesc = errorDesc.c_str ();

	TTiXmlNode* node = 0;
	for ( node = firstChild; node; node = node->NextSibling() )
	{
		target->LinkEndChild( node->Clone() );
	}	
}
Exemple #2
0
void TTiXmlDocument::CopyTo( TTiXmlDocument* target ) const
{
	TTiXmlNode::CopyTo( target );

	target->error = error;
	target->errorId = errorId;
	target->errorDesc = errorDesc;
	target->tabsize = tabsize;
	target->errorLocation = errorLocation;
	target->useMicrosoftBOM = useMicrosoftBOM;

	TTiXmlNode* node = 0;
	for ( node = firstChild; node; node = node->NextSibling() )
	{
		target->LinkEndChild( node->Clone() );
	}	
}
Exemple #3
0
void TTiXmlElement::CopyTo( TTiXmlElement* target ) const
{
	// superclass:
	TTiXmlNode::CopyTo( target );

	// Element class: 
	// Clone the attributes, then clone the children.
	const TTiXmlAttribute* attribute = 0;
	for(	attribute = attributeSet.First();
	attribute;
	attribute = attribute->Next() )
	{
		target->SetAttribute( attribute->Name(), attribute->Value() );
	}

	TTiXmlNode* node = 0;
	for ( node = firstChild; node; node = node->NextSibling() )
	{
		target->LinkEndChild( node->Clone() );
	}
}