mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
Minor tweak remove redundant "/' and string message improvements
This commit is contained in:
committed by
Mat Sutcliffe
parent
360edca4b3
commit
c899bfbea7
@@ -137,8 +137,8 @@ namespace BlackMisc
|
||||
{
|
||||
static const QString ms("by model string");
|
||||
static const QString icao("by ICAO");
|
||||
static const QString icaoAircraft("by ICAO, aircraft first");
|
||||
static const QString icaoAirline("by ICAO, airline first");
|
||||
static const QString icaoAircraft("by ICAO aircraft first");
|
||||
static const QString icaoAirline("by ICAO airline first");
|
||||
static const QString family("by family");
|
||||
static const QString forceMil("force military");
|
||||
static const QString forceCiv("force civilian");
|
||||
|
||||
@@ -412,6 +412,27 @@ namespace BlackMisc
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
QString removeSurroundingApostrophes(const QString &in)
|
||||
{
|
||||
if (in.size() < 2) { return in; }
|
||||
if (in.startsWith("'") && in.endsWith("'"))
|
||||
{
|
||||
return in.mid(1, in.length() - 2);
|
||||
}
|
||||
return in;
|
||||
}
|
||||
|
||||
QString removeSurroundingQuotes(const QString &in)
|
||||
{
|
||||
if (in.size() < 2) { return in; }
|
||||
if (in.startsWith("\"") && in.endsWith("\""))
|
||||
{
|
||||
return in.mid(1, in.length() - 2);
|
||||
}
|
||||
return in;
|
||||
}
|
||||
|
||||
} // ns
|
||||
|
||||
//! \endcond
|
||||
|
||||
@@ -204,6 +204,12 @@ namespace BlackMisc
|
||||
//! Return string in quotes
|
||||
BLACKMISC_EXPORT QString inQuotes(const QString &in, bool ignoreEmpty = false);
|
||||
|
||||
//! Remove surrounding apostrophes 'foo' -> foo
|
||||
BLACKMISC_EXPORT QString removeSurroundingApostrophes(const QString &in);
|
||||
|
||||
//! Remove surrounding quotes "foo" -> foo
|
||||
BLACKMISC_EXPORT QString removeSurroundingQuotes(const QString &in);
|
||||
|
||||
//! Bool to on/off
|
||||
BLACKMISC_EXPORT const QString &boolToOnOff(bool v);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user