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/daeDatabase.h"
     10 using namespace std;
     11 
     12 daeDatabase::daeDatabase(DAE& dae) : dae(dae) { }
     13 
     14 DAE* daeDatabase::getDAE() {
     15 	return &dae;
     16 }
     17 
     18 daeDocument* daeDatabase::getDoc(daeUInt index) {
     19 	return getDocument(index);
     20 }
     21 
     22 daeElement* daeDatabase::idLookup(const string& id, daeDocument* doc) {
     23 	vector<daeElement*> elts = idLookup(id);
     24 	for (size_t i = 0; i < elts.size(); i++)
     25 		if (elts[i]->getDocument() == doc)
     26 			return elts[i];
     27 	return NULL;
     28 }
     29 
     30 vector<daeElement*> daeDatabase::typeLookup(daeInt typeID, daeDocument* doc) {
     31 	vector<daeElement*> result;
     32 	typeLookup(typeID, result);
     33 	return result;
     34 }
     35 
     36 vector<daeElement*> daeDatabase::sidLookup(const string& sid, daeDocument* doc) {
     37 	vector<daeElement*> result;
     38 	sidLookup(sid, result, doc);
     39 	return result;
     40 }
     41