summaryrefslogtreecommitdiff
path: root/src/configfile.h
diff options
context:
space:
mode:
authorChristian Glöckner <cgloeckner@freenet.de>2016-03-29 11:32:00 +0200
committerAndré Nusser <andre.nusser@googlemail.com>2016-03-31 17:35:47 +0200
commitcc292a3ee15253d09cb5cb0a24ea143a4423be13 (patch)
tree4c2195b308baafcf6dfaf4bb49d8ffba8a011fcc /src/configfile.h
parent11fee241287c3d26a7dc7a24fe68270a90ee0e73 (diff)
Made API of class ConfigFile more consistent
Diffstat (limited to 'src/configfile.h')
-rw-r--r--src/configfile.h34
1 files changed, 16 insertions, 18 deletions
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 <string>
#include <map>
#include <stdio.h>
-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<std::string, std::string> values;
- std::string filename;
+ std::map<std::string, std::string> 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__*/