diff options
author | André Nusser <andre.nusser@googlemail.com> | 2020-04-07 22:19:10 +0200 |
---|---|---|
committer | André Nusser <andre.nusser@googlemail.com> | 2020-04-08 20:56:29 +0200 |
commit | ad8c3a178ddbf561e08d800372979eaf54986a9c (patch) | |
tree | d654b16f1cf79663acc875d7d8fb92132e217812 /src/configfile.h | |
parent | 22d2d946da85e513b67affc87dfef2b42ded3b27 (diff) |
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
Diffstat (limited to 'src/configfile.h')
-rw-r--r-- | src/configfile.h | 8 |
1 files changed, 3 insertions, 5 deletions
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 <string> #include <map> -#include <stdio.h> +#include <fstream> class ConfigFile { @@ -45,11 +45,9 @@ public: protected: std::map<std::string, std::string> 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; }; |