|
|
template<class F > |
| QString | swift::misc::removeChars (const QString &s, F predicate) |
| | Return a string with characters removed that match the given predicate.
|
| |
|
QString | swift::misc::removeIfInString (const QString &string, const QString &inString) |
| | Remove if in string.
|
| |
|
QString | swift::misc::removeIfNotInString (const QString &string, const QString &inString) |
| | Remove if NOT in string.
|
| |
|
QString | swift::misc::removeLineBreakAndTab (const QString &s) |
| | Remove line breaks and tabs.
|
| |
|
SWIFT_MISC_EXPORT QString | swift::misc::removeDateTimeSeparators (const QString &s) |
| | Remove the typical separators such as "-", " ".
|
| |
|
template<class F > |
| bool | swift::misc::containsChar (const QString &s, F predicate) |
| | True if any character in the string matches the given predicate.
|
| |
|
bool | swift::misc::containsLineBreakOrTab (const QString &s) |
| | Contains a line break or tab.
|
| |
|
template<class F > |
| int | swift::misc::indexOfChar (const QString &s, F predicate) |
| | Index of first character in the string matching the given predicate, or -1 if not found.
|
| |
|
SWIFT_MISC_EXPORT qsizetype | swift::misc::nthIndexOf (const QString &string, QChar ch, int nth=1, Qt::CaseSensitivity cs=Qt::CaseInsensitive) |
| | nth index of ch
|
| |
| template<class F > |
| QList< QStringView > | swift::misc::splitStringRefs (const QString &s, F predicate) |
| | Split a string into multiple strings, using a predicate function to identify the split points. More...
|
| |
| SWIFT_MISC_EXPORT QList< QStringView > | swift::misc::splitLinesRefs (const QString &s) |
| | Split a string into multiple lines. Blank lines are skipped. More...
|
| |
|
template<class F > |
| void | swift::misc::splitStringRefs (const QString &&, F)=delete |
| | It would be risky to call splitStringRefs with an rvalue, so forbid it.
|
| |
|
void | swift::misc::splitLinesRefs (const QString &&)=delete |
| | It would be risky to call splitLinesRefs with an rvalue, so forbid it.
|
| |
|
template<class F > |
| QStringList | swift::misc::splitString (const QString &s, F predicate) |
| | Split a string into multiple strings, using a predicate function to identify the split points.
|
| |
|
SWIFT_MISC_EXPORT QStringList | swift::misc::splitLines (const QString &s) |
| | Split a string into multiple lines. Blank lines are skipped.
|
| |
|
SWIFT_MISC_EXPORT QByteArray | swift::misc::utfToPercentEncoding (const QString &s, const QByteArray &allow={}, char percent='%') |
| | Extended percent encoding supporting UTF-16.
|
| |
|
SWIFT_MISC_EXPORT QString | swift::misc::utfFromPercentEncoding (const QByteArray &ba, char percent='%') |
| | Reverse utfFromPercentEncoding.
|
| |
|
template<class K , class V > |
| QString | swift::misc::qmapToString (const QMap< K, V > &map) |
| | A map converted to string.
|
| |
|
SWIFT_MISC_EXPORT QMap< QString, QString > | swift::misc::parseIniValues (const QString &data) |
| | Obtain ini file like values, e.g. foo=bar.
|
| |
|
bool | swift::misc::is09 (const QChar &c) |
| | Is 0-9 char, isDigit allows a bunch of more characters.
|
| |
|
bool | swift::misc::is09OrSeparator (const QChar &c) |
| | Is 0-9, or ","/";".
|
| |
|
const QString & | swift::misc::safeAt (const QStringList &stringList, int index) |
| | Safe "at" function, returns empty string if index does not exists.
|
| |
|
bool | swift::misc::isDigitsOnlyString (const QString &testString) |
| | String with digits only.
|
| |
|
bool | swift::misc::is09OnlyString (const QString &testString) |
| | String with 0-9 only.
|
| |
|
bool | swift::misc::is09OrSeparatorOnlyString (const QString &testString) |
| | String with 0-9/separator only.
|
| |
|
QString | swift::misc::digitOnlyString (const QString &string) |
| | String only with digits.
|
| |
|
QString | swift::misc::char09OnlyString (const QString &string) |
| | String only with 0-9.
|
| |
|
QString | swift::misc::char09OrSeparatorOnlyString (const QString &string) |
| | String only with 0-9, or separator.
|
| |
|
QString | swift::misc::asciiOnlyString (const QString &string) |
| | String only with ASCII values.
|
| |
|
SWIFT_MISC_EXPORT QString | swift::misc::inApostrophes (const QString &in, bool ignoreEmpty=false) |
| | Return string in apostrophes.
|
| |
|
SWIFT_MISC_EXPORT QString | swift::misc::inQuotes (const QString &in, bool ignoreEmpty=false) |
| | Return string in quotes.
|
| |
|
SWIFT_MISC_EXPORT bool | swift::misc::hasBalancedQuotes (const QString &in, char quote='"') |
| | Has balanced quotes.
|
| |
|
SWIFT_MISC_EXPORT QString | swift::misc::removeSurroundingApostrophes (const QString &in) |
| | Remove surrounding apostrophes 'foo' -> foo.
|
| |
|
SWIFT_MISC_EXPORT QString | swift::misc::removeSurroundingQuotes (const QString &in) |
| | Remove surrounding quotes "foo" -> foo.
|
| |
|
SWIFT_MISC_EXPORT const QString & | swift::misc::boolToOnOff (bool v) |
| | Bool to on/off.
|
| |
|
SWIFT_MISC_EXPORT const QString & | swift::misc::boolToYesNo (bool v) |
| | Bool to yes/no.
|
| |
|
SWIFT_MISC_EXPORT const QString & | swift::misc::boolToTrueFalse (bool v) |
| | Bool to true/false.
|
| |
|
SWIFT_MISC_EXPORT const QString & | swift::misc::boolToEnabledDisabled (bool v) |
| | Bool to enabled/disabled.
|
| |
|
SWIFT_MISC_EXPORT const QString & | swift::misc::boolToNullNotNull (bool isNull) |
| | Bool isNull to null/no null.
|
| |
|
SWIFT_MISC_EXPORT bool | swift::misc::stringToBool (const QString &boolString) |
| | Convert string to bool.
|
| |
| SWIFT_MISC_EXPORT int | swift::misc::fuzzyShortStringComparision (const QString &str1, const QString &str2, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
| | Fuzzy compare for short strings (like ICAO designators) More...
|
| |
|
SWIFT_MISC_EXPORT QString | swift::misc::intToHex (int value, int digits=2) |
| | Int to hex value.
|
| |
|
SWIFT_MISC_EXPORT QString | swift::misc::dotToLocaleDecimalPoint (QString &input) |
| | Replace dot '.' by locale decimal point.
|
| |
|
SWIFT_MISC_EXPORT QString | swift::misc::dotToLocaleDecimalPoint (const QString &input) |
| | Replace dot '.' by locale decimal point.
|
| |
|
SWIFT_MISC_EXPORT QString | swift::misc::stripDesignatorFromCompleterString (const QString &candidate) |
| | Strip a designator from a combined string.
|
| |
|
SWIFT_MISC_EXPORT QString | swift::misc::simplifyAccents (const QString &candidate) |
| | Remove accents / diacritic marks from a string.
|
| |
|
SWIFT_MISC_EXPORT QString | swift::misc::simplifyByDecomposition (const QString &candidate) |
| | Remove accents / diacritic marks from a string by doing a Unicode decomposition and removing mark characters.
|
| |
|
SWIFT_MISC_EXPORT bool | swift::misc::caseInsensitiveStringCompare (const QString &c1, const QString &c2) |
| | Case insensitive string compare.
|
| |
|
SWIFT_MISC_EXPORT bool | swift::misc::stringCompare (const QString &c1, const QString &c2, Qt::CaseSensitivity cs) |
| | String compare.
|
| |
|
SWIFT_MISC_EXPORT QString | swift::misc::simplifyNameForSearch (const QString &name) |
| | Get a simplified upper case name for searching by removing all characters except A-Z.
|
| |
|
SWIFT_MISC_EXPORT QString | swift::misc::withQuestionMark (const QString &question) |
| | Add a question mark at the end if not existing.
|
| |
| SWIFT_MISC_EXPORT QDateTime | swift::misc::fromStringUtc (const QString &dateTimeString, const QString &format) |
| | Same as QDateTime::fromString but QDateTime will be set to UTC. More...
|
| |
| SWIFT_MISC_EXPORT QDateTime | swift::misc::fromStringUtc (const QString &dateTimeString, Qt::DateFormat format=Qt::TextDate) |
| | Same as QDateTime::fromString but QDateTime will be set to UTC. More...
|
| |
| SWIFT_MISC_EXPORT QDateTime | swift::misc::fromStringUtc (const QString &dateTimeString, const QLocale &locale, QLocale::FormatType format) |
| | Same as QDateTime::fromString but QDateTime will be set to UTC. More...
|
| |
| SWIFT_MISC_EXPORT QDateTime | swift::misc::parseMultipleDateTimeFormats (const QString &dateTimeString) |
| | Parse multiple date time formats. More...
|
| |
| SWIFT_MISC_EXPORT QDateTime | swift::misc::parseDateTimeStringOptimized (const QString &dateTimeString) |
| | Parse yyyyMMddHHmmsszzz strings optimized. More...
|
| |
|
SWIFT_MISC_EXPORT QString | swift::misc::joinStringSet (const QSet< QString > &set, const QString &separator) |
| | Convert string to bool.
|
| |
|
SWIFT_MISC_EXPORT QString | swift::misc::removeComments (const QString &in, bool removeSlash, bool removeDoubleSlash) |
| | Remove comments such as /** **/ or //.
|
| |
|
SWIFT_MISC_EXPORT bool | swift::misc::containsAny (const QString &testString, const QStringList &any, Qt::CaseSensitivity cs) |
| | Contains any string of the list?
|
| |
|
SWIFT_MISC_EXPORT double | swift::misc::parseFraction (const QString &fraction, double failDefault=std::numeric_limits< double >::quiet_NaN()) |
| | Parse a fraction like 2/3.
|
| |
|
SWIFT_MISC_EXPORT QString | swift::misc::cleanNumber (const QString &number) |
| | Remove leading 0, trailing 0, " ", and "." from a number.
|
| |