diff options
author | André Nusser <andre.nusser@googlemail.com> | 2016-03-22 00:40:15 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-03-29 22:43:30 +0200 |
commit | 31ac3fd56ce77cfb2e9caddd0bdac0614971d98b (patch) | |
tree | b1d1546af97495e06b9129bcae08cefcfc98897e /src/configparser.h | |
parent | efe93864d53f72be4fa4dfe003f0f7578fc558e2 (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__*/ |