--- /dev/null
+#ifndef MSP_DATAFILE_DIRECTORYSOURCE_H_
+#define MSP_DATAFILE_DIRECTORYSOURCE_H_
+
+#include <msp/fs/path.h>
+#include "collectionsource.h"
+
+namespace Msp {
+namespace DataFile {
+
+/**
+A source that load items from files in a directory.
+*/
+class DirectorySource: public CollectionSource
+{
+private:
+ std::list<FS::Path> dirs;
+
+public:
+ DirectorySource();
+
+ void set_directory(const FS::Path &);
+ void add_directory(const FS::Path &);
+
+ virtual bool is_loadable(const CollectionItemTypeBase &, const std::string &) const;
+ virtual NameList get_names(const CollectionItemTypeBase &) const;
+ virtual void load(Collection &, const CollectionItemTypeBase &, const std::string &) const;
+
+ bool lookup_file(const std::string &, FS::Path &) const;
+};
+
+} // namespace DataFile
+} // namespace Msp
+
+#endif