mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-24 05:08:38 -05:00
5b1a2c3acc
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3569 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
51 lines
1.3 KiB
C++
51 lines
1.3 KiB
C++
/*
|
|
* 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
|
|
|