1 #ifndef MSP_DATAFILE_DIRECTORYSOURCE_H_
2 #define MSP_DATAFILE_DIRECTORYSOURCE_H_
4 #include <msp/fs/path.h>
5 #include "collectionsource.h"
11 A source that load items from files in a directory.
13 class DirectorySource: public CollectionSource
16 typedef std::map<std::string, FS::Path> ObjectMap;
21 void add_directory(const FS::Path &, bool = true);
23 virtual bool is_loadable(const CollectionItemTypeBase &, const std::string &) const;
24 virtual NameList get_names(const CollectionItemTypeBase &) const;
25 virtual void load(Collection &, const CollectionItemTypeBase &, const std::string &) const;
26 virtual IO::Seekable *open(const std::string &) const;
28 bool lookup_file(const std::string &, FS::Path &) const;
31 } // namespace DataFile