-FS::Path Catalogue3D::locate_file(const string &name)
-{
- if(FS::exists(name))
- return name;
-
- FS::Path path = FS::Path("data")/name;
- if(FS::exists(path))
- return path;
-
- throw runtime_error("Can't locate "+name);
-}
-
-template<typename T>
-T *Catalogue3D::create(const string &name)
-{
- RefPtr<T> obj = new T;
- DataFile::load(*obj, locate_file(name).str());
- return obj.release();
-}
-
-template<typename T>
-T *Catalogue3D::create2(const string &name)
-{
- RefPtr<T> obj = new T;
- DataFile::load(*obj, locate_file(name).str(), *this);
- return obj.release();
-}
-