JS8Call-Improved master
Loading...
Searching...
No Matches
CountryDat.h
Go to the documentation of this file.
1
9
10#ifndef __COUNTRYDAT_H
11#define __COUNTRYDAT_H
12
13#include <QHash>
14#include <QString>
15#include <QStringList>
16
26 public:
31 void init(const QString filename);
32
36 void load();
37
43 QString find(QString prefix) const; // return country name or ""
44
49 QStringList getCountryNames() const { return _countryNames; };
50
51 private:
55 QString _extractName(const QString line) const;
56
60 void _removeBrackets(QString &line, const QString a, const QString b) const;
61
67 QStringList _extractPrefix(QString &line, bool &more) const;
68
72 QString fixup(QString country, QString const &call) const;
73
74 QString _filename;
75 QStringList _countryNames;
76 QHash<QString, QString> _data;
77};
78
79#endif
Reader and lookup helper for CTY prefix files.
Definition CountryDat.h:25
void load()
Parse the configured file and populate the internal mapping.
Definition CountryDat.cpp:98
QString find(QString prefix) const
Find the country/entity name for a callsign prefix.
Definition CountryDat.cpp:145
QStringList getCountryNames() const
Get a list of country/entity names discovered in the file.
Definition CountryDat.h:49
void init(const QString filename)
Set the filename of the CTY/cty.dat file to parse.
Definition CountryDat.cpp:33