1 #ifndef MSP_DATAFILE_DIRECTORYSOURCE_H_
2 #define MSP_DATAFILE_DIRECTORYSOURCE_H_
4 #include <msp/fs/path.h>
5 #include "collectionsource.h"
6 #include "mspdatafile_api.h"
12 A source that load items from files in a directory.
14 class MSPDATAFILE_API DirectorySource: public CollectionSource
17 typedef std::map<std::string, FS::Path> ObjectMap;
22 void add_directory(const FS::Path &, bool = true);
24 bool is_loadable(const CollectionItemTypeBase &, const std::string &) const override;
25 NameList get_names(const CollectionItemTypeBase &) const override;
26 void load(Collection &, const CollectionItemTypeBase &, const std::string &) const override;
27 IO::Seekable *open(const std::string &) const override;
29 bool lookup_file(const std::string &, FS::Path &) const;
32 } // namespace DataFile