From: Mikko Rasa Date: Sat, 23 May 2009 06:20:33 +0000 (+0000) Subject: Replace one more stray load function with DataFile::load X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=65cbaf88a03497df08243ac27354b0c0ea1f640b;p=r2c2.git Replace one more stray load function with DataFile::load --- diff --git a/source/designer/designer.cpp b/source/designer/designer.cpp index 39999df..f2c6fb8 100644 --- a/source/designer/designer.cpp +++ b/source/designer/designer.cpp @@ -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); diff --git a/source/engineer/engineer.cpp b/source/engineer/engineer.cpp index be4c050..4b8ba70 100644 --- a/source/engineer/engineer.cpp +++ b/source/engineer/engineer.cpp @@ -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 &args=getopt.get_args(); if(args.empty()) diff --git a/source/libmarklin/catalogue.cpp b/source/libmarklin/catalogue.cpp index 8faaa10..1b181df 100644 --- a/source/libmarklin/catalogue.cpp +++ b/source/libmarklin/catalogue.cpp @@ -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(c) diff --git a/source/libmarklin/catalogue.h b/source/libmarklin/catalogue.h index 5f13999..4ce6fb1 100644 --- a/source/libmarklin/catalogue.h +++ b/source/libmarklin/catalogue.h @@ -39,7 +39,6 @@ public: const std::map &get_tracks() const { return tracks; } LocoType &get_locomotive(unsigned) const; const std::map &get_locomotives() const { return locos; } - void load(const std::string &); }; } // namespace Marklin