From bfdb184d349d2b8ecf4ea993793182cb32098e12 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 13 Nov 2015 19:21:31 +0100 Subject: Refactored Resource and added unittests. --- plugingui/resource.h | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'plugingui/resource.h') diff --git a/plugingui/resource.h b/plugingui/resource.h index 4b494f7..101c689 100644 --- a/plugingui/resource.h +++ b/plugingui/resource.h @@ -24,8 +24,7 @@ * along with DrumGizmo; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#ifndef __DRUMGIZMO_RESOURCE_H__ -#define __DRUMGIZMO_RESOURCE_H__ +#pragma once #include @@ -33,21 +32,19 @@ namespace GUI { class Resource { public: - Resource(std::string name); + Resource(const std::string& name); - const char *data(); - size_t size(); + const char* data(); + size_t size(); - bool valid(); + bool valid(); -private: - std::string e_data; - bool is_valid; - bool is_internal; - const char *i_data; - size_t i_size; +protected: + std::string externalData; + bool isValid = false; + bool isInternal = false; + const char *internalData = nullptr; + size_t internalSize = 0; }; -}; - -#endif/*__DRUMGIZMO_RESOURCE_H__*/ +} // GUI:: -- cgit v1.2.3