| 
									
										
										
										
											2018-02-08 21:28:33 -05:00
										 |  |  | /* | 
					
						
							|  |  |  |  * 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 QDateTime; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class ADIF | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	public: | 
					
						
							|  |  |  | 	void init(QString const& filename); | 
					
						
							|  |  |  | 	void load(); | 
					
						
							|  |  |  | 	void add(QString const& call, QString const& band, QString const& mode, QString const& date); | 
					
						
							|  |  |  | 	bool match(QString const& call, QString const& band, QString const& mode) const; | 
					
						
							|  |  |  | 	QList<QString> getCallList() const; | 
					
						
							|  |  |  | 	int getCount() const; | 
					
						
							|  |  |  | 		 | 
					
						
							|  |  |  |         // open ADIF file and append the QSO details. Return true on success | 
					
						
							| 
									
										
										
										
											2018-08-05 11:33:30 -04:00
										 |  |  | 	bool addQSOToFile(QByteArray const& ADIF_record); | 
					
						
							| 
									
										
										
										
											2018-02-08 21:28:33 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-05 11:33:30 -04:00
										 |  |  |   QByteArray QSOToADIF(QString const& hisCall, QString const& hisGrid, QString const& mode, QString const& rptSent | 
					
						
							|  |  |  | 											 , QString const& rptRcvd, QDateTime const& dateTimeOn, QDateTime const& dateTimeOff | 
					
						
							|  |  |  | 											 , QString const& band, QString const& comments, QString const& name | 
					
						
							|  |  |  | 											 , QString const& strDialFreq, QString const& m_myCall, QString const& m_myGrid | 
					
						
							|  |  |  | 											 , QString const& m_txPower, QString const& operator_call); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							| 
									
										
										
										
											2018-02-08 21:28:33 -05:00
										 |  |  | 		struct QSO | 
					
						
							|  |  |  | 		{ | 
					
						
							|  |  |  | 		  QString call,band,mode,date; | 
					
						
							|  |  |  | 		};		   | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		QMultiHash<QString, QSO> _data; | 
					
						
							|  |  |  | 		QString _filename; | 
					
						
							|  |  |  | 		 | 
					
						
							|  |  |  | 		QString extractField(QString const& line, QString const& fieldName) const; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif | 
					
						
							|  |  |  | 
 |