diff options
author | André Nusser <andre.nusser@googlemail.com> | 2016-03-22 00:40:15 +0100 |
---|---|---|
committer | André Nusser <andre.nusser@googlemail.com> | 2016-03-29 22:19:49 +0200 |
commit | 0930fdc014bf36fb9e2715b3d14bff5fedf354a9 (patch) | |
tree | 9136c06ba9311f164e03156312ed449367acf20a /src/configparser.h | |
parent | 866b09992668f97af063dcd77dc5dd0e3a512b94 (diff) |
Parser refactoring.
* Use new style
* Update to C++11
* Use more std::string than char*
Diffstat (limited to 'src/configparser.h')
-rw-r--r-- | src/configparser.h | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/configparser.h b/src/configparser.h index b5f4d74..1e8aa56 100644 --- a/src/configparser.h +++ b/src/configparser.h @@ -24,26 +24,24 @@ * along with DrumGizmo; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#ifndef __DRUMGIZMO_CONFIGPARSER_H__ -#define __DRUMGIZMO_CONFIGPARSER_H__ +#pragma once #include <map> #include "saxparser.h" -class ConfigParser : public SAXParser { +class ConfigParser : + public SAXParser +{ public: - ConfigParser(); + ConfigParser(); - void characterData(std::string &data); - void startTag(std::string name, attr_t attr); - void endTag(std::string name); - std::string value(std::string name, std::string def = ""); - void parseError(char *buf, size_t len, std::string error, int lineno); + void characterData(const std::string& data) override; + void startTag(const std::string& name, attr_t& attr) override; + void endTag(const std::string& name) override; + std::string value(const std::string& name, const std::string& def = ""); private: - std::map<std::string, std::string> values; - std::string *str; + std::map<std::string, std::string> values; + std::string* str; }; - -#endif/*__DRUMGIZMO_CONFIGPARSER_H__*/ |