Use QString::arg instead of std::sprintf

This commit is contained in:
Mat Sutcliffe
2020-12-15 23:35:57 +00:00
parent 5c40a22875
commit f2eba38282
2 changed files with 5 additions and 15 deletions

View File

@@ -234,15 +234,6 @@ namespace BlackMisc
//! Convert string to bool
BLACKMISC_EXPORT bool stringToBool(const QString &boolString);
//! Convert string (begin and end iterators of char) to int
template <typename It>
int stringToInt(It begin, It end)
{
int result = 0;
std::for_each(begin, end, [&result](char c) { Q_ASSERT(is09(c)); result *= 10; result += (c - '0'); });
return result;
}
//! Fuzzy compare for short strings (like ICAO designators)
//! \return int 0..100 (100 is perfect match)
BLACKMISC_EXPORT int fuzzyShortStringComparision(const QString &str1, const QString &str2, Qt::CaseSensitivity cs = Qt::CaseSensitive);