30 Serializer(
const QString& p_value):value(p_value.toUtf8()) {};
34 value = QByteArray((
char*)data.mv_data, data.mv_size);
35 return QString::fromUtf8(value);
37 void deserialize(
const MDB_val& data, QString& result) {
38 value = QByteArray((
char*)data.mv_data, data.mv_size);
39 result = QString::fromUtf8(value);
41 MDB_val
setData(
const QString& data) {
42 value = data.toUtf8();
47 result.mv_data = value.data();
48 result.mv_size = value.size();
A class handling serialization/deserialization.
Definition serializer.h:33
~Serializer()
Destoys the serializer.
Definition serializer.hpp:69
Serializer()
Creates an empty Serializer.
Definition serializer.hpp:40
MDB_val getData()
Returns the data if it already was serialized.
Definition serializer.hpp:153
T deserialize(const MDB_val &value)
Deserializes value.
Definition serializer.hpp:99
void clear()
Clears the state of serializer.
Definition serializer.hpp:137
MDB_val setData(const T &value)
Sets the data to the seriazer.
Definition serializer.hpp:83