mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 23:45:35 +08:00
Ref T242, utility functions for matching
* search among airline aircraft * improved logging information * search among airline ICAO aircraft (which aircraft does the airline use?) * check ecosystem before merging with VATSIM data
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include "stringutils.h"
|
||||
#include <QChar>
|
||||
#include <QTextCodec>
|
||||
#include <QStringBuilder>
|
||||
#include <QRegularExpression>
|
||||
|
||||
namespace BlackMisc
|
||||
@@ -322,6 +323,14 @@ namespace BlackMisc
|
||||
if (cs == Qt::CaseSensitive) { return c1 == c2; }
|
||||
return caseInsensitiveStringCompare(c1, c2);
|
||||
}
|
||||
|
||||
const QString inApostrophes(const QString &in, bool ignoreEmpty)
|
||||
{
|
||||
static const QString e;
|
||||
static const QString ea("''");
|
||||
if (in.isEmpty()) { return ignoreEmpty ? e : ea; }
|
||||
return QStringLiteral("'") % in % QStringLiteral("'");
|
||||
}
|
||||
}
|
||||
|
||||
//! \endcond
|
||||
|
||||
Reference in New Issue
Block a user