]> git.tdb.fi Git - libs/datafile.git/blob - source/collection.cpp
c1d72ca8e3b82e2f3b24b2d550d089efc8e2967c
[libs/datafile.git] / source / collection.cpp
1 #include "collection.h"
2
3 namespace Msp {
4 namespace DataFile {
5
6 Collection::~Collection()
7 {
8         for(ItemMap::iterator i = items.begin(); i!=items.end(); ++i)
9                 delete i->second;
10         for(ItemKeywordSeq::iterator i = keywords.begin(); i!=keywords.end(); ++i)
11                 delete *i;
12         for(ItemCreatorSeq::iterator i = creators.begin(); i!=creators.end(); ++i)
13                 delete *i;
14 }
15
16 bool Collection::contains(const std::string &n) const
17 {
18         return items.count(n);
19 }
20
21
22 Collection::Loader::Loader(Collection &c):
23         coll(c)
24 {       
25         for(ItemKeywordSeq::const_iterator i = coll.keywords.begin(); i!=coll.keywords.end(); ++i)
26                 (*i)->add_to_loader(*this);
27 }
28
29 } // namespace DataFile
30 } // namespace Msp