Ref T264, string utility function

This commit is contained in:
Klaus Basan
2018-05-22 11:20:45 +02:00
parent 1d8bbaf3be
commit a7a1674faa
2 changed files with 9 additions and 0 deletions

View File

@@ -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

View File

@@ -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);