summaryrefslogtreecommitdiff
path: root/src/drumkitparser.h
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2016-03-22 00:40:15 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2016-03-29 22:43:30 +0200
commit31ac3fd56ce77cfb2e9caddd0bdac0614971d98b (patch)
treeb1d1546af97495e06b9129bcae08cefcfc98897e /src/drumkitparser.h
parentefe93864d53f72be4fa4dfe003f0f7578fc558e2 (diff)
Parser refactoring.
* Use new style * Update to C++11 * Use more std::string than char*
Diffstat (limited to 'src/drumkitparser.h')
-rw-r--r--src/drumkitparser.h39
1 files changed, 18 insertions, 21 deletions
diff --git a/src/drumkitparser.h b/src/drumkitparser.h
index b59e81b..91456d4 100644
--- a/src/drumkitparser.h
+++ b/src/drumkitparser.h
@@ -24,37 +24,34 @@
* along with DrumGizmo; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#ifndef __DRUMGIZMO_DRUMKITPARSER_H__
-#define __DRUMGIZMO_DRUMKITPARSER_H__
+#pragma once
#include "saxparser.h"
#include "drumkit.h"
#include "configfile.h"
-class DrumKitParser : public SAXParser {
+class DrumKitParser
+ : public SAXParser
+{
public:
- DrumKitParser(const std::string &kitfile, DrumKit &kit);
- ~DrumKitParser();
-
- void startTag(std::string name,
- std::map< std::string, std::string> attributes);
- void endTag(std::string name);
+ DrumKitParser(const std::string& kitfile, DrumKit& kit);
+ ~DrumKitParser();
protected:
- int readData(char *data, size_t size);
+ void startTag(const std::string& name, attr_t& attributes) override;
+ void endTag(const std::string& name) override;
+
+ int readData(std::string& data, std::size_t size) override;
private:
- FILE *fd;
- DrumKit &kit;
- // Instrument *instr;
- std::string path;
+ FILE* fd;
+ DrumKit& kit;
+ std::string path;
- std::map<std::string, std::string> channelmap;
- std::string instr_file;
- std::string instr_name;
- std::string instr_group;
+ std::map<std::string, std::string> channelmap;
+ std::string instr_file;
+ std::string instr_name;
+ std::string instr_group;
- ConfigFile refs;
+ ConfigFile refs;
};
-
-#endif/*__DRUMGIZMO_DRUMKITPARSER_H__*/