From 0930fdc014bf36fb9e2715b3d14bff5fedf354a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Tue, 22 Mar 2016 00:40:15 +0100 Subject: Parser refactoring. * Use new style * Update to C++11 * Use more std::string than char* --- src/drumkitparser.h | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) (limited to 'src/drumkitparser.h') 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 channelmap; - std::string instr_file; - std::string instr_name; - std::string instr_group; + std::map channelmap; + std::string instr_file; + std::string instr_name; + std::string instr_group; - ConfigFile refs; + ConfigFile refs; }; - -#endif/*__DRUMGIZMO_DRUMKITPARSER_H__*/ -- cgit v1.2.3