aboutsummaryrefslogtreecommitdiff
path: root/lot.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lot.cpp')
-rw-r--r--lot.cpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/lot.cpp b/lot.cpp
new file mode 100644
index 0000000..d421064
--- /dev/null
+++ b/lot.cpp
@@ -0,0 +1,58 @@
+#include <lot.h>
+
+DcLot::DcLot(QObject *parent)
+ : QObject(parent)
+{
+}
+
+DcLot::DcLot(dc_lot_t *lot)
+ : m_lot{lot}
+{
+}
+
+DcLot::~DcLot()
+{
+ dc_lot_unref(m_lot);
+}
+
+QString
+DcLot::getText1() const
+{
+ char *text1 = dc_lot_get_text1(m_lot);
+ QString result{text1};
+ dc_str_unref(text1);
+ return result;
+}
+
+QString
+DcLot::getText2() const
+{
+ char *text2 = dc_lot_get_text2(m_lot);
+ QString result{text2};
+ dc_str_unref(text2);
+ return result;
+}
+
+int
+DcLot::getText1Meaning() const
+{
+ return dc_lot_get_text1_meaning(m_lot);
+}
+
+int
+DcLot::getState() const
+{
+ return dc_lot_get_state(m_lot);
+}
+
+uint32_t
+DcLot::getId() const
+{
+ return dc_lot_get_id(m_lot);
+}
+
+int64_t
+DcLot::getTimestamp() const
+{
+ return dc_lot_get_timestamp(m_lot);
+}