namespace Msp {
namespace DataFile {
-void DirectorySource::add_directory(const FS::Path &d)
+void DirectorySource::add_directory(const FS::Path &d, bool replace)
{
list<string> files = FS::list_files(d);
for(list<string>::const_iterator i=files.begin(); i!=files.end(); ++i)
- objects[*i] = d / *i;
+ {
+ if(!objects.count(*i) || replace)
+ objects[*i] = d / *i;
+ }
}
bool DirectorySource::is_loadable(const CollectionItemTypeBase &, const string &name) const
ObjectMap objects;
public:
- void add_directory(const FS::Path &);
+ void add_directory(const FS::Path &, bool = true);
virtual bool is_loadable(const CollectionItemTypeBase &, const std::string &) const;
virtual NameList get_names(const CollectionItemTypeBase &) const;