-
Notifications
You must be signed in to change notification settings - Fork 0
/
autoprice.cpp
34 lines (30 loc) · 849 Bytes
/
autoprice.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <QVariantMap>
#include <QDataStream>
#include "autoprice.h"
#include "serialize.h"
QDataStream &operator<<(QDataStream &out, const AutoPrice &s)
{
QVariantMap map;
map["expression"] << s.expression_;
map["currency_name"] << s.currency_name_;
map["value"] << s.value_;
map["has_value"] << s.has_value_;
map["enabled"] << s.enabled_;
map["matches"] << s.matches;
map["mismatches"] << s.mismatches;
out << map;
return out;
}
QDataStream &operator>>(QDataStream &in, AutoPrice &s)
{
QVariantMap map;
in >> map;
map["expression"] >> s.expression_;
map["currency_name"] >> s.currency_name_;
map["value"] >> s.value_;
map["has_value"] >> s.has_value_;
map["enabled"] >> s.enabled_;
map["matches"] >> s.matches;
map["mismatches"] >> s.mismatches;
return in;
}