Browse Source

comment

master
squeaky otter 6 years ago
parent
commit
0c02e869be
1 changed files with 11 additions and 3 deletions
  1. +11
    -3
      adif_parser.cpp

+ 11
- 3
adif_parser.cpp View File

@ -248,7 +248,15 @@ QMap<int, QStringList> AdifParser::getQso() {
*/
QMap<QString, QString> AdifParser::getElements(QString line) {
QMap<QString, QString> elements;
QRegExp rx("(<\\w+:\\d+(:\\w)?>[^<]*)");
/*
* Well, about RXP
* That regexp can explode if you have a "<" inside a (MULTI)STRING
* Since ADIF allows it
* We dont care. ADIF format in it's NON-XML form is :
* A T.O.T.A.L P.A.I.N I.N T.H.E A.S.*
* So well, dont give a shit, minimal support and **** ***.
*/
QRegExp rx("(<\\w+:\\d+(:\\w)?>[^<]*)"); // RXP
int fPos = 0;
while ((fPos = rx.indexIn(line, fPos)) != -1) {
@ -259,8 +267,8 @@ QMap<QString, QString> AdifParser::getElements(QString line) {
// now regexp-parse the item to get key/value
// really ignore size and type
QRegExp iRx("<(\\w+):(\\d+)>([^<]+)");
QRegExp iRx2("<(\\w+):(\\d+):(\\w+)>([^<]+)");
QRegExp iRx("<(\\w+):(\\d+)>([^<]+)"); // RXP
QRegExp iRx2("<(\\w+):(\\d+):(\\w+)>([^<]+)"); // RXP
if (iRx.indexIn(el) != -1) {
if (debug)
qDebug() << "Got name-val1" << iRx.cap(1) << iRx.cap(3).trimmed();


Loading…
Cancel
Save