From 1ec122d6579a6f1850753a2b72ae04d4bd9981a0 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 14 Dec 2015 11:38:03 +0100 Subject: Build with latest flatbuffers We now have actual booleans --- common/propertymapper.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/common/propertymapper.h b/common/propertymapper.h index fbde2d9..fb5accc 100644 --- a/common/propertymapper.h +++ b/common/propertymapper.h @@ -79,6 +79,14 @@ public: return propertyToVariant((buffer->*f)()); }); } + + template + void addMapping(const QByteArray &name, bool (Buffer::*f)() const) + { + addMapping(name, [f](Buffer const *buffer) -> QVariant { + return propertyToVariant((buffer->*f)()); + }); + } private: QHash > mReadAccessors; }; @@ -109,6 +117,16 @@ public: }); } + template + void addMapping(const QByteArray &name, void (BufferBuilder::*f)(bool)) + { + addMapping(name, [f](const QVariant &value, flatbuffers::FlatBufferBuilder &fbb) -> std::function { + return [value, f](BufferBuilder &builder) { + (builder.*f)(value.value()); + }; + }); + } + template void addMapping(const QByteArray &name, void (BufferBuilder::*f)(flatbuffers::Offset)) { -- cgit v1.2.3