JS8Call-Improved master
Loading...
Searching...
No Matches
ADIF Class Reference

Parser and in-memory store for ADIF QSO records. More...

#include <ADIF.h>

Classes

struct  QSO
 Minimal representation of a QSO (contact) record. More...

Public Member Functions

void init (QString const &filename)
 Initialize the ADIF handler with a filename.
void load ()
 Load and parse the configured ADIF file into memory.
void add (QString const &call, QString const &band, QString const &mode, const QString &submode, QString const &grid, QString const &date, const QString &name, const QString &comment)
 Add a QSO to the in-memory store.
bool match (QString const &call, QString const &band) const
 Test whether a call/band combination exists in memory.
QList< ADIF::QSOfind (QString const &call) const
 Find all QSOs matching a callsign.
QList< QString > getCallList () const
 Get a list of unique calls found in the in-memory store.
qsizetype getCount () const
 Number of QSO records currently stored in memory.
bool addQSOToFile (QByteArray const &ADIF_record)
 Append a raw ADIF record to the configured ADIF file.
QByteArray QSOToADIF (QString const &hisCall, QString const &hisGrid, QString const &mode, QString const &submode, 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 &operator_call, const QMap< QString, QVariant > &additionalFields)
 Convert QSO parameters into a ADIF formatted record.

Detailed Description

Parser and in-memory store for ADIF QSO records.

The ADIF class provides basic functionality to read ADIF files into an in-memory container, search for QSOs by callsign, and append new QSO records back to the ADIF file.

Member Function Documentation

◆ add()

void ADIF::add ( QString const & call,
QString const & band,
QString const & mode,
const QString & submode,
QString const & grid,
QString const & date,
const QString & name,
const QString & comment )

Add a QSO to the in-memory store.

Add a new QSO to the internal data structure.

Parameters
callRemote station callsign.
bandBand string (e.g. "20m").
modeMode string (e.g. "FT8").
submodeSubmode string, if any.
gridMaidenhead grid square of the remote station.
dateDate string for the QSO.
nameName associated with the remote station.
commentOptional comment.
callThe callsign of the contacted station.
bandThe band on which the QSO was made.
modeThe mode of the QSO.
submodeThe submode of the QSO.
gridThe grid locator of the contacted station.
dateThe date of the QSO.
nameThe name of the operator.
commentAny comments associated with the QSO.
Here is the caller graph for this function:

◆ addQSOToFile()

bool ADIF::addQSOToFile ( QByteArray const & ADIF_record)

Append a raw ADIF record to the configured ADIF file.

Open the ADIF file and append the QSO details.

Parameters
ADIF_recordByte array containing a properly formatted ADIF record.
Returns
true on success, false on failure (e.g. file I/O error).
Parameters
ADIF_recordThe ADIF record to append.
Returns
True on success, false otherwise.

◆ find()

QList< ADIF::QSO > ADIF::find ( QString const & call) const

Find all QSOs matching a callsign.

Find QSOs associated with a given callsign.

Parameters
callCallsign to search for.
Returns
List of QSO records matching the callsign.
Parameters
callThe callsign to search for.
Returns
A list of QSOs associated with the callsign.

◆ getCallList()

QList< QString > ADIF::getCallList ( ) const

Get a list of unique calls found in the in-memory store.

Get a list of all callsigns in the internal data structure.

Returns
List of callsigns as strings.
A list of callsigns.

◆ getCount()

qsizetype ADIF::getCount ( ) const

Number of QSO records currently stored in memory.

Get the count of QSOs in the internal data structure.

Returns
Count of stored QSOs.
The number of QSOs.

◆ init()

void ADIF::init ( QString const & filename)

Initialize the ADIF handler with a filename.

Initialize the ADIF instance with the specified filename.

Parameters
filenamePath to the ADIF file to read or append to.
filenameThe path to the ADIF log file.

◆ load()

void ADIF::load ( )

Load and parse the configured ADIF file into memory.

Load ADIF records from the specified file into the internal data structure.

After calling this method, the in-memory store is populated and searchable via find and getCallList.

Here is the call graph for this function:

◆ match()

bool ADIF::match ( QString const & call,
QString const & band ) const

Test whether a call/band combination exists in memory.

Check if a callsign and band combination exists in the internal data structure.

Parameters
callCallsign to match.
bandBand to match.
Returns
true if a matching QSO exists, false otherwise.
Parameters
callThe callsign to search for.
bandThe band to search for.
Returns
True if a matching QSO is found, false otherwise.

◆ QSOToADIF()

QByteArray ADIF::QSOToADIF ( QString const & hisCall,
QString const & hisGrid,
QString const & mode,
QString const & submode,
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 & operator_call,
const QMap< QString, QVariant > & additionalFields )

Convert QSO parameters into a ADIF formatted record.

Convert QSO details into an ADIF record format.

This helper builds a byte array containing a single ADIF record using the provided fields. Additional fields may be appended via additionalFields.

Returns
ADIF record as a QByteArray suitable for appending to file.
Parameters
hisCallThe callsign of the contacted station.
hisGridThe grid locator of the contacted station.
modeThe mode of the QSO.
submodeThe submode of the QSO.
rptSentThe report sent.
rptRcvdThe report received.
dateTimeOnThe date and time when the QSO started.
dateTimeOffThe date and time when the QSO ended.
bandThe band on which the QSO was made.
commentsAny comments associated with the QSO.
nameThe name of the operator.
strDialFreqThe dial frequency as a string.
m_myCallThe station's own callsign.
m_myGridThe station's own grid locator.
operator_callThe operator's callsign.
additionalFieldsA map of additional ADIF fields to include.
Returns
The ADIF record as a QByteArray.

The documentation for this class was generated from the following files: