From: Mikko Rasa Date: Sat, 18 Jun 2011 18:31:27 +0000 (+0300) Subject: Use IO::BufferedFile instead of separate File and Buffered objects X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=eb0f6a0fc9ad34a54df2d9f22e4326c23ddb5bc6;p=libs%2Fdatafile.git Use IO::BufferedFile instead of separate File and Buffered objects --- diff --git a/source/loader.h b/source/loader.h index 126de57..2213616 100644 --- a/source/loader.h +++ b/source/loader.h @@ -9,7 +9,6 @@ Distributed under the LGPL #define MSP_DATAFILE_LOADER_H_ #include -#include #include #include "except.h" #include "loaderaction.h" @@ -202,10 +201,9 @@ Loads an object from a file. The object must have a public Loader class. template void load(T &obj, const std::string &fn) { - IO::File in(fn); - IO::Buffered buf(in); + IO::BufferedFile in(fn); - Parser parser(buf, fn); + Parser parser(in, fn); typename T::Loader loader(obj); loader.load(parser); } @@ -213,10 +211,9 @@ void load(T &obj, const std::string &fn) template void load(T &obj, const std::string &fn, U &arg) { - IO::File in(fn); - IO::Buffered buf(in); + IO::BufferedFile in(fn); - Parser parser(buf, fn); + Parser parser(in, fn); typename T::Loader loader(obj, arg); loader.load(parser); }