1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-03 14:34:57 -04:00

Add Navtex transmitters and French DAB transmitters to Map

This commit is contained in:
Jon Beniston
2023-03-03 17:14:56 +00:00
parent 84e15c587f
commit d9f27485c3
8 changed files with 264 additions and 9 deletions
+4 -4
View File
@@ -70,7 +70,7 @@ QHash<QString, QString> *CSV::hash(const QString& filename, int reserve)
// Read a row from a CSV file (handling quotes)
// https://stackoverflow.com/questions/27318631/parsing-through-a-csv-file-in-qt
bool CSV::readRow(QTextStream &in, QStringList *row)
bool CSV::readRow(QTextStream &in, QStringList *row, char separator)
{
static const int delta[][5] = {
// , " \n ? eof
@@ -101,7 +101,7 @@ bool CSV::readRow(QTextStream &in, QStringList *row)
else
{
in >> ch;
if (ch == ',') {
if (ch == separator) {
t = 0;
} else if (ch == '\"') {
t = 1;
@@ -137,13 +137,13 @@ bool CSV::readRow(QTextStream &in, QStringList *row)
// Read header row from CSV file and return a hash mapping names to column numbers
// Returns error if header row can't be read, or if all of requiredColumns aren't found
QHash<QString, int> CSV::readHeader(QTextStream &in, QStringList requiredColumns, QString &error)
QHash<QString, int> CSV::readHeader(QTextStream &in, QStringList requiredColumns, QString &error, char separator)
{
QHash<QString, int> colNumbers;
QStringList row;
// Read column names
if (CSV::readRow(in, &row))
if (CSV::readRow(in, &row, separator))
{
// Create hash mapping column names to indices
for (int i = 0; i < row.size(); i++) {