From eb0f6a0fc9ad34a54df2d9f22e4326c23ddb5bc6 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 18 Jun 2011 21:31:27 +0300 Subject: [PATCH] Use IO::BufferedFile instead of separate File and Buffered objects --- source/loader.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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); } -- 2.45.2