mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-19 03:45:30 +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; }
|
if (in.isEmpty()) { return ignoreEmpty ? e : ea; }
|
||||||
return QStringLiteral("\"") % in % QStringLiteral("\"");
|
return QStringLiteral("\"") % in % QStringLiteral("\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString withQUestionMark(const QString &question)
|
||||||
|
{
|
||||||
|
if (question.endsWith("?")) { return question; }
|
||||||
|
return question + "?";
|
||||||
|
}
|
||||||
} // ns
|
} // ns
|
||||||
|
|
||||||
//! \endcond
|
//! \endcond
|
||||||
|
|||||||
@@ -181,6 +181,9 @@ namespace BlackMisc
|
|||||||
//! Get a simplified upper case name for searching by removing all characters except A-Z
|
//! Get a simplified upper case name for searching by removing all characters except A-Z
|
||||||
BLACKMISC_EXPORT QString simplifyNameForSearch(const QString &name);
|
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
|
//! Parse multiple date time formats
|
||||||
//! \remark potentially slow, so only to be used when format is unknown
|
//! \remark potentially slow, so only to be used when format is unknown
|
||||||
BLACKMISC_EXPORT QDateTime parseMultipleDateTimeFormats(const QString &dateTimeString);
|
BLACKMISC_EXPORT QDateTime parseMultipleDateTimeFormats(const QString &dateTimeString);
|
||||||
|
|||||||
Reference in New Issue
Block a user