From ad8c3a178ddbf561e08d800372979eaf54986a9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Tue, 7 Apr 2020 22:19:10 +0200 Subject: Refactoring configfile. The most important changes are: * general cleaning up * changing to platform independent newline in reading and writing * changing the Windows config directory to DrumGizmo (instead of .drumgizmo) And also, regarding the old code: C called, they wanted all their file operations back. ;-p --- src/configfile.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/configfile.h') diff --git a/src/configfile.h b/src/configfile.h index 47ae80b..1513897 100644 --- a/src/configfile.h +++ b/src/configfile.h @@ -28,7 +28,7 @@ #include #include -#include +#include class ConfigFile { @@ -45,11 +45,9 @@ public: protected: std::map values; std::string filename; + std::fstream current_file; - virtual bool open(std::string mode); - void close(); + virtual bool open(std::ios_base::openmode mode); std::string readLine(); bool parseLine(const std::string& line); - - FILE* fp; }; -- cgit v1.2.3