]> git.tdb.fi Git - r2c2.git/commitdiff
Replace one more stray load function with DataFile::load
authorMikko Rasa <tdb@tdb.fi>
Sat, 23 May 2009 06:20:33 +0000 (06:20 +0000)
committerMikko Rasa <tdb@tdb.fi>
Sat, 23 May 2009 06:20:33 +0000 (06:20 +0000)
source/designer/designer.cpp
source/engineer/engineer.cpp
source/libmarklin/catalogue.cpp
source/libmarklin/catalogue.h

index 39999df2e5d69b869159f59ec06fb04e8fdcc46c..f2c6fb8c00559fb463629205036c3dfd083a1ea7 100644 (file)
@@ -46,7 +46,7 @@ Designer::Designer(int argc, char **argv):
        rotate(0),
        pitch(0)
 {
-       catalogue.load("tracks.dat");
+       DataFile::load(catalogue, "tracks.dat");
 
        cat_layout=new Layout(catalogue);
        cat_layout_3d=new Layout3D(*cat_layout);
index be4c050b9ccf1fee465b2d222aab7115354097da..4b8ba70a1426940ecadffdd8d8c367959d2b5785 100644 (file)
@@ -78,8 +78,8 @@ Engineer::Engineer(int argc, char **argv):
 
        layout_3d.set_quality(quality);
 
-       catalogue.load("tracks.dat");
-       catalogue.load("locos.dat");
+       DataFile::load(catalogue, "tracks.dat");
+       DataFile::load(catalogue, "locos.dat");
 
        const vector<string> &args=getopt.get_args();
        if(args.empty())
index 8faaa102596a2db071d23bc70135bdf227f29fcd..1b181dffc0ec856ba76f87a6af54f8697971c968 100644 (file)
@@ -40,15 +40,6 @@ LocoType &Catalogue::get_locomotive(unsigned art_nr) const
        return *i->second;
 }
 
-void Catalogue::load(const string &fn)
-{
-       IO::File in(fn.c_str());
-
-       DataFile::Parser parser(in, fn);
-       Loader loader(*this);
-       loader.load(parser);
-}
-
 
 Catalogue::Loader::Loader(Catalogue &c):
        DataFile::BasicLoader<Catalogue>(c)
index 5f13999dd26e7ed91fd648c60eec766d066d022a..4ce6fb1b712de8daa3d32f988d5ec5d43f0b6623 100644 (file)
@@ -39,7 +39,6 @@ public:
        const std::map<unsigned, TrackType *> &get_tracks() const { return tracks; }
        LocoType &get_locomotive(unsigned) const;
        const std::map<unsigned, LocoType *> &get_locomotives() const { return locos; }
-       void  load(const std::string &);
 };
 
 } // namespace Marklin