X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcollection.cpp;h=aa607bdedcde65ecfd298b21af06fc9dc42aeac2;hb=00795982c9a99dcad69b33f75d38328165bd5df8;hp=070991948d33d7315074ec6bb480cc06344d45cc;hpb=a5d5fa04bcbe360fc55fdb25b45937b29fb5c9cd;p=libs%2Fdatafile.git diff --git a/source/collection.cpp b/source/collection.cpp index 0709919..aa607bd 100644 --- a/source/collection.cpp +++ b/source/collection.cpp @@ -91,6 +91,15 @@ void Collection::add_source(CollectionSource &s) sources.push_back(&s); } +IO::Seekable *Collection::open_from_sources(const string &name) +{ + for(SourceList::const_iterator i=sources.begin(); i!=sources.end(); ++i) + if(IO::Seekable *io = (*i)->open(name)) + return io; + + return 0; +} + void Collection::gather_names_from_sources(list &names, const CollectionItemTypeBase &type) const { for(SourceList::const_iterator i=sources.begin(); i!=sources.end(); ++i)