X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcollection.cpp;fp=source%2Fcollection.cpp;h=984fb74da8e7a6007645e6f85aa002b8ae6f894a;hb=9b1656018f783eb4aad2fbdc1de1404691e89bb1;hp=070991948d33d7315074ec6bb480cc06344d45cc;hpb=e44432ecb5d2c0a288652ac6ed9d06f51a68d395;p=libs%2Fdatafile.git diff --git a/source/collection.cpp b/source/collection.cpp index 0709919..984fb74 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; + + throw IO::file_not_found(name); +} + void Collection::gather_names_from_sources(list &names, const CollectionItemTypeBase &type) const { for(SourceList::const_iterator i=sources.begin(); i!=sources.end(); ++i)