From cc292a3ee15253d09cb5cb0a24ea143a4423be13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Gl=C3=B6ckner?= Date: Tue, 29 Mar 2016 11:32:00 +0200 Subject: Made API of class ConfigFile more consistent --- src/configfile.h | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'src/configfile.h') diff --git a/src/configfile.h b/src/configfile.h index 3a781ec..47ae80b 100644 --- a/src/configfile.h +++ b/src/configfile.h @@ -24,34 +24,32 @@ * along with DrumGizmo; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#ifndef __DRUMGIZMO_CONFIGFILE_H__ -#define __DRUMGIZMO_CONFIGFILE_H__ +#pragma once #include #include #include -class ConfigFile { +class ConfigFile +{ public: - ConfigFile(std::string filename); - virtual ~ConfigFile(); + ConfigFile(std::string const& filename); + virtual ~ConfigFile(); - virtual bool load(); - virtual bool save(); + virtual bool load(); + virtual bool save(); - virtual std::string getValue(const std::string& key); - virtual void setValue(const std::string& key, const std::string& value); + virtual std::string getValue(const std::string& key) const; + virtual void setValue(const std::string& key, const std::string& value); protected: - std::map values; - std::string filename; + std::map values; + std::string filename; - virtual bool open(std::string mode); - void close(); - std::string readLine(); - bool parseLine(const std::string& line); + virtual bool open(std::string mode); + void close(); + std::string readLine(); + bool parseLine(const std::string& line); - FILE* fp; + FILE* fp; }; - -#endif/*__DRUMGIZMO_CONFIGFILE_H__*/ -- cgit v1.2.3