summaryrefslogtreecommitdiff
path: root/src/drumkitparser.h
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2016-03-22 00:40:15 +0100
committerAndré Nusser <andre.nusser@googlemail.com>2016-03-22 17:16:03 +0100
commit0728a11284f15100a8f8e0d9da0192019a056d6a (patch)
treedd430619bc74314ae21941102f1f1f92769d9ddc /src/drumkitparser.h
parent8e2124ad955b51efb2f539998a369d7ca07cbc73 (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 d9ec4fe..5c97b4e 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__*/