Home | History | Annotate | Download | only in dae
      1 /*
      2 * Copyright 2006 Sony Computer Entertainment Inc.
      3 *
      4 * Licensed under the MIT Open Source License, for details please see license.txt or the website
      5 * http://www.opensource.org/licenses/mit-license.php
      6 *
      7 */
      8 
      9 #include <dae/daeMetaAny.h>
     10 #include <dae/domAny.h>
     11 #include <dae/daeMetaElementAttribute.h>
     12 #include <dae.h>
     13 
     14 daeMetaAny::daeMetaAny( daeMetaElement *container, daeMetaCMPolicy *parent, daeUInt ordinal,
     15 												 daeInt minO, daeInt maxO) : daeMetaCMPolicy( container, parent, ordinal, minO, maxO )
     16 {}
     17 
     18 daeMetaAny::~daeMetaAny()
     19 {}
     20 
     21 daeElement *daeMetaAny::placeElement( daeElement *parent, daeElement *child, daeUInt &ordinal, daeInt offset, daeElement* before, daeElement *after ) {
     22 	//remove element from praent
     23 	(void)offset;
     24 	(void)before;
     25 	(void)after;
     26 	daeElement::removeFromParent( child );
     27 	child->setParentElement( parent );
     28 	//*************************************************************************
     29 	ordinal = 0;
     30 	return child;
     31 }
     32 
     33 daeBool daeMetaAny::removeElement( daeElement *parent, daeElement *child ) {
     34 	(void)parent;
     35 	(void)child;
     36 	return true;
     37 }
     38 
     39 daeMetaElement * daeMetaAny::findChild( daeString elementName ) {
     40 	if ( elementName != NULL ) {
     41 		const daeMetaElementRefArray &metas = _container->getDAE()->getAllMetas();
     42 		size_t cnt = metas.getCount();
     43 		for ( size_t x = 0; x < cnt; x++ ) {
     44 			if ( metas[x] && !metas[x]->getIsInnerClass() && strcmp( elementName, metas[x]->getName() ) == 0 ) {
     45 				return metas[x];
     46 			}
     47 		}
     48 	}
     49 	return domAny::registerElement(*_container->getDAE());
     50 }
     51 
     52 void daeMetaAny::getChildren( daeElement *parent, daeElementRefArray &array ) {
     53 	(void)parent;
     54 	(void)array;
     55 	//this is taken care of by the _contents in metaElement
     56 }
     57 
     58