summaryrefslogtreecommitdiff
path: root/plugingui/resource.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2015-11-13 19:21:31 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2015-11-13 19:21:31 +0100
commitbfdb184d349d2b8ecf4ea993793182cb32098e12 (patch)
tree40bbf053556453f8f3de87f69c3aae0a6a87f57f /plugingui/resource.h
parentca384e485956059d5d427fbe07a7b2277c43680e (diff)
Refactored Resource and added unittests.
Diffstat (limited to 'plugingui/resource.h')
-rw-r--r--plugingui/resource.h27
1 files changed, 12 insertions, 15 deletions
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 <string>
@@ -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::