From 2e98a7f6eb11a071a8ac232bcbb37abea85f6f06 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 2 Feb 2016 13:52:04 +0100 Subject: Cleaner EntityBuffer constructor --- common/entitybuffer.cpp | 6 ++++++ common/entitybuffer.h | 2 ++ 2 files changed, 8 insertions(+) (limited to 'common') diff --git a/common/entitybuffer.cpp b/common/entitybuffer.cpp index 344bccc..b4a5cb2 100644 --- a/common/entitybuffer.cpp +++ b/common/entitybuffer.cpp @@ -18,6 +18,12 @@ EntityBuffer::EntityBuffer(const void *dataValue, int dataSize) } } +EntityBuffer::EntityBuffer(const QByteArray &data) + : EntityBuffer(data.constData(), data.size()) +{ + +} + bool EntityBuffer::isValid() const { return mEntity; diff --git a/common/entitybuffer.h b/common/entitybuffer.h index 0c0162d..495e94e 100644 --- a/common/entitybuffer.h +++ b/common/entitybuffer.h @@ -3,6 +3,7 @@ #include "sinkcommon_export.h" #include #include +#include namespace Sink { struct Entity; @@ -10,6 +11,7 @@ struct Entity; class SINKCOMMON_EXPORT EntityBuffer { public: EntityBuffer(const void *dataValue, int size); + EntityBuffer(const QByteArray &data); const uint8_t *resourceBuffer(); const uint8_t *metadataBuffer(); const uint8_t *localBuffer(); -- cgit v1.2.3