mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-24 07:55:35 +08:00
Ref T264, string utility function
This commit is contained in:
@@ -339,6 +339,12 @@ namespace BlackMisc
|
||||
if (in.isEmpty()) { return ignoreEmpty ? e : ea; }
|
||||
return QStringLiteral("\"") % in % QStringLiteral("\"");
|
||||
}
|
||||
|
||||
QString withQUestionMark(const QString &question)
|
||||
{
|
||||
if (question.endsWith("?")) { return question; }
|
||||
return question + "?";
|
||||
}
|
||||
} // ns
|
||||
|
||||
//! \endcond
|
||||
|
||||
@@ -181,6 +181,9 @@ namespace BlackMisc
|
||||
//! Get a simplified upper case name for searching by removing all characters except A-Z
|
||||
BLACKMISC_EXPORT QString simplifyNameForSearch(const QString &name);
|
||||
|
||||
//! Add a question mark at the end if not existing
|
||||
BLACKMISC_EXPORT QString withQUestionMark(const QString &question);
|
||||
|
||||
//! Parse multiple date time formats
|
||||
//! \remark potentially slow, so only to be used when format is unknown
|
||||
BLACKMISC_EXPORT QDateTime parseMultipleDateTimeFormats(const QString &dateTimeString);
|
||||
|
||||
Reference in New Issue
Block a user