X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdirectorycollection.h;h=a796054b43569d4892e919ec5a337c4daba25409;hb=8955db30f9cd1c1566b349da29e669f065f84e36;hp=93f93545b589708f312fce6d87c1330de8f79ac3;hpb=a4091f14dfbf4d5f822fa26740a7b3f305c449e6;p=libs%2Fdatafile.git diff --git a/source/directorycollection.h b/source/directorycollection.h index 93f9354..a796054 100644 --- a/source/directorycollection.h +++ b/source/directorycollection.h @@ -22,6 +22,10 @@ protected: void set_directory(const FS::Path &); void add_directory(const FS::Path &); + /** Examines the names of files in the designated directories and adds any + applicable ones as future objects. */ + void load_names(); + template CollectionItemType &add_type() { @@ -36,13 +40,17 @@ private: if(lookup_file(name, file)) { RefPtr item = new T; - load(*item, file.str()); + ItemLoader ldr(*item, *this); + IO::BufferedFile in(file.str()); + Parser parser(in, file.str()); + ldr.load(parser); return item.release(); } else return 0; } +protected: bool lookup_file(const std::string &, FS::Path &) const; };