summaryrefslogtreecommitdiff
path: root/logbook/adif.h
diff options
context:
space:
mode:
authorIain R. Learmonth <irl@debian.org>2015-10-18 18:51:00 +0100
committerIain R. Learmonth <irl@debian.org>2015-10-18 18:51:00 +0100
commitd63dd8d081a6fcd0715cd13f26df59fb831769d2 (patch)
treeb9c1f6245147a310aac3762630bad389bbb57335 /logbook/adif.h
parentc720a3d55c5ec832c29cb7ce50b6fb4b70c55b11 (diff)
Imported Upstream version 1.5.0upstream/1.5.0
Diffstat (limited to 'logbook/adif.h')
-rw-r--r--logbook/adif.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/logbook/adif.h b/logbook/adif.h
new file mode 100644
index 00000000..7445d4aa
--- /dev/null
+++ b/logbook/adif.h
@@ -0,0 +1,50 @@
+/*
+ * Reads an ADIF log file into memory
+ * Searches log for call, band and mode
+ * VK3ACF July 2013
+ */
+
+
+#ifndef __ADIF_H
+#define __ADIF_H
+
+#if defined (QT5)
+#include <QList>
+#include <QString>
+#include <QMultiHash>
+#else
+#include <QtGui>
+#endif
+
+
+class ADIF
+{
+ public:
+ void init(QString filename);
+ void load();
+ void add(const QString call, const QString band, const QString mode, const QString date);
+ bool match(const QString call, const QString band, const QString mode);
+ QList<QString> getCallList();
+ int getCount();
+
+ // open ADIF file and append the QSO details. Return true on success
+ bool addQSOToFile(const QString hisCall, const QString hisGrid, const QString mode, const QString rptSent, const QString rptRcvd, const QString date, const QString time, const QString band,
+ const QString comments, const QString name, const QString strDialFreq, const QString m_myCall, const QString m_myGrid, const QString m_txPower);
+
+ static QString bandFromFrequency(double dialFreq);
+
+ private:
+ struct QSO
+ {
+ QString call,band,mode,date;
+ };
+
+ QMultiHash<QString, QSO> _data;
+ QString _filename;
+
+ QString _extractField(const QString line, const QString fieldName);
+};
+
+
+#endif
+