libdrmconf  0.11.3
A library to program DMR radios.
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CSVReader Class Reference

Implements the text-file codeplug reader. More...

#include <csvreader.hh>

Inheritance diagram for CSVReader:
Inheritance graph
[legend]
Collaboration diagram for CSVReader:
Collaboration graph
[legend]

Public Member Functions

virtual bool handleRadioId (const QList< qint64 > &ids, qint64 line, qint64 column, QString &errorMessage)
 Gets called once the DMR IDs has been parsed.
 
virtual bool handleRadioName (const QString &name, qint64 line, qint64 column, QString &errorMessage)
 Gets called once the radio name has been parsed.
 
virtual bool handleIntroLine1 (const QString &text, qint64 line, qint64 column, QString &errorMessage)
 Gets called once the first intro line has been parsed.
 
virtual bool handleIntroLine2 (const QString &text, qint64 line, qint64 column, QString &errorMessage)
 Gets called once the second intro line has been parsed.
 
virtual bool handleMicLevel (unsigned level, qint64 line, qint64 column, QString &errorMessage)
 Gets called once the MIC level has been parsed.
 
virtual bool handleSpeech (bool speech, qint64 line, qint64 column, QString &errorMessage)
 Gets called once the Speech flag has been parsed.
 
virtual bool handleDTMFContact (qint64 idx, const QString &name, const QString &num, bool rxTone, qint64 line, qint64 column, QString &errorMessage)
 Gets called once a DTMF contact has been parsed.
 
virtual bool handleDigitalContact (qint64 idx, const QString &name, DMRContact::Type type, qint64 id, bool rxTone, qint64 line, qint64 column, QString &errorMessage)
 Gets called once a digital contact has been parsed.
 
virtual bool handleGroupList (qint64 idx, const QString &name, const QList< qint64 > &contacts, qint64 line, qint64 column, QString &errorMessage)
 Gets called once an RX group list has been parsed.
 
virtual bool handleDigitalChannel (qint64 idx, const QString &name, double rx, double tx, Channel::Power power, qint64 scan, qint64 tot, bool ro, DMRChannel::Admit admit, qint64 color, DMRChannel::TimeSlot slot, qint64 gl, qint64 contact, qint64 gps, qint64 roam, qint64 radioID, qint64 line, qint64 column, QString &errorMessage)
 Gets called once a digital channel has been parsed.
 
virtual bool handleAnalogChannel (qint64 idx, const QString &name, double rx, double tx, Channel::Power power, qint64 scan, qint64 aprs, qint64 tot, bool ro, FMChannel::Admit admit, qint64 squelch, Signaling::Code rxTone, Signaling::Code txTone, FMChannel::Bandwidth bw, qint64 line, qint64 column, QString &errorMessage)
 Gets called once a analog channel has been parsed.
 
virtual bool handleZone (qint64 idx, const QString &name, bool a, const QList< qint64 > &channels, qint64 line, qint64 column, QString &errorMessage)
 Gets called once a zone list has been parsed.
 
virtual bool handleGPSSystem (qint64 idx, const QString &name, qint64 contactIdx, qint64 period, qint64 revertChannelIdx, qint64 line, qint64 column, QString &errorMessage)
 Gets called once a GPS system has been parsed.
 
virtual bool handleAPRSSystem (qint64 idx, const QString &name, qint64 channelIdx, qint64 period, const QString &src, unsigned srcSSID, const QString &dest, unsigned destSSID, const QString &path, const QString &icon, const QString &message, qint64 line, qint64 column, QString &errorMessage)
 Gets called once a APRS system has been parsed.
 
virtual bool handleScanList (qint64 idx, const QString &name, qint64 pch1, qint64 pch2, qint64 txch, const QList< qint64 > &channels, qint64 line, qint64 column, QString &errorMessage)
 Gets called once a scan list has been parsed.
 
virtual bool handleRoamingZone (qint64 idx, const QString &name, const QList< qint64 > &channels, qint64 line, qint64 column, QString &errorMessage)
 Gets called once a roaming zone list has been parsed.
 
- Public Member Functions inherited from CSVHandler
virtual ~CSVHandler ()
 Destructor.
 

Static Public Member Functions

static bool read (Config *config, QTextStream &stream, QString &errorMessage)
 Reads a config file from stream and stores the read configuration into config. More...
 

Protected Member Functions

 CSVReader (Config *config, QObject *parent=nullptr)
 Hidden constructor. More...
 
- Protected Member Functions inherited from CSVHandler
 CSVHandler (QObject *parent=nullptr)
 Hidden constructor.
 

Protected Attributes

bool _link
 If true, the reader is in "link" mode.
 
Config_config
 The configuration to read.
 
QMap< int, Channel * > _channels
 Index <-> Channel map.
 
QMap< int, DMRContact * > _digital_contacts
 Index <-> Digital contact map.
 
QMap< int, RXGroupList * > _rxgroups
 Index <-> RX group list map.
 
QMap< int, Zone * > _zones
 Index <-> Zone map.
 
QMap< int, PositioningSystem * > _posSystems
 Index <-> GPS System map.
 
QMap< int, ScanList * > _scanlists
 Index <-> Scan list map.
 
QMap< int, RoamingZone * > _roamingZones
 Index <-> RoamingZone map.
 
QMap< int, DMRRadioID * > _radioIDs
 Index <-> radio ID map.
 

Detailed Description

Implements the text-file codeplug reader.

Constructor & Destructor Documentation

◆ CSVReader()

CSVReader::CSVReader ( Config config,
QObject *  parent = nullptr 
)
protected

Hidden constructor.

Consider using the static read method.

Member Function Documentation

◆ read()

bool CSVReader::read ( Config config,
QTextStream &  stream,
QString &  errorMessage 
)
static

Reads a config file from stream and stores the read configuration into config.

Returns
true on success.

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