X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcollection.cpp;h=bf1c5edc211e93b33f1dacc833e0ac1a38657a5e;hb=b1bc25649c1f22abf940a807d934f1e9bb780c28;hp=a16ae5a9dc2e7a9f70f638093348b59c8bd561eb;hpb=495920e971324d29bd4933b8a319fb5668ca5562;p=libs%2Fdatafile.git diff --git a/source/collection.cpp b/source/collection.cpp index a16ae5a..bf1c5ed 100644 --- a/source/collection.cpp +++ b/source/collection.cpp @@ -11,20 +11,9 @@ Collection::~Collection() delete *i; } -void Collection::add_future(const std::string &name) +void Collection::add_source(CollectionSource &s) { - if(items.count(name)) - throw key_error(typeid(ItemMap)); - - for(TypeList::const_iterator i=types.begin(); i!=types.end(); ++i) - if((*i)->match_name(name)) - { - items.insert(ItemMap::value_type(name, (*i)->create_future())); - return; - } - - /* XXX throw something? If we do, DirectoryCollection needs some way to - check if a name matches any item type. */ + sources.push_back(&s); }