//---------------------------------------------------------------
    Parameters& BaseExtraTechnique::getChildParameters ( 
        ChildElementsMap& childElements,
        const String& childName )
    {
        // Is the given childElement already in the map?
        ChildElementsMap::iterator it = childElements.find ( childName );

        if ( it == childElements.end() )
            childElements.insert ( ChildElement ( childName, Parameters() ) );

        it = childElements.find ( childName );
        if ( it == childElements.end() ) { COLLADABU_ASSERT ( "Can't create a child parameter!" ); }

        return ( *it ).second;
    }
Пример #2
0
void XMLElement :: DumpOn( std::ostream & os, bool recurse  ) const {
	os << "<" << Name();
	for ( unsigned int i = 0; i < AttrCount(); i++ ) {
		os << " " << AttrName(i) << "=\"";
		os << AttrValue( AttrName(i) ) << "\"";
	}
	if ( ! recurse ) {
		os << "/>\n";
	}
	else {
		os << ">\n";
		for ( unsigned int i = 0; i < ChildCount(); i++ ) {
			const XMLElement * ce = ChildElement( i ) ;
			if ( ce ) {
				ce->DumpOn( os, recurse );
			}
			const XMLText * ct = ChildText( i );
			if ( ct ) {
				os << LTrim( ct->Text() ) << "\n";
			}
		}
		os << "</" << Name() << ">\n";
	}
}