13#include <QElapsedTimer>
16#include <QRegularExpression>
17#include <QRegularExpressionMatch>
19#include <QStringBuilder>
45using namespace swift::misc::aviation;
46using namespace swift::misc::geo;
47using namespace swift::misc::math;
48using namespace swift::misc::network;
49using namespace swift::misc::physical_quantities;
50using namespace swift::misc::simulation;
54namespace swift::sample
61 CSamplesPerformance::copy10kStations(1);
67 out <<
"created (copy) " << atcs1.
size() <<
" ATC stations in " << ms <<
"ms" <<
Qt::endl;
72 out <<
"created (copy) " << atcs2.
size() <<
" ATC stations in " << ms <<
"ms" <<
Qt::endl;
78 out <<
"created (propertyIndex) " << atcs3.
size() <<
" ATC stations in " << ms <<
"ms" <<
Qt::endl;
83 out <<
"created (propertyIndex) " << atcs4.
size() <<
" ATC stations in " << ms <<
"ms" <<
Qt::endl;
89 out <<
"Sorted by callsign " << atcs1.
size() <<
" ATC stations in " << ms <<
"ms" <<
Qt::endl;
94 out <<
"Sorted by callsign " << atcs2.
size() <<
" ATC stations in " << ms <<
"ms" <<
Qt::endl;
98 CSamplesPerformance::accessStationsData(atcs1,
false);
100 out <<
"Read (getters) " << atcs1.
size() <<
" ATC stations in " << ms <<
"ms" <<
Qt::endl;
103 CSamplesPerformance::accessStationsData(atcs2,
false);
105 out <<
"Read (getters) " << atcs2.
size() <<
" ATC stations in " << ms <<
"ms" <<
Qt::endl;
108 CSamplesPerformance::accessStationsData(atcs1,
true);
110 out <<
"Read (propertyIndex) " << atcs1.
size() <<
" ATC stations in " << ms <<
"ms" <<
Qt::endl;
113 CSamplesPerformance::accessStationsData(atcs2,
true);
115 out <<
"Read (propertyIndex) " << atcs2.
size() <<
" ATC stations in " << ms <<
"ms" <<
Qt::endl;
120 CSamplesPerformance::calculateDistance(number);
122 out <<
"Calculated distances " << number <<
" in " << ms <<
"ms" <<
Qt::endl;
126 CSamplesPerformance::calculateDistance(number);
128 out <<
"Calculated distances " << number <<
"in " << ms <<
"ms" <<
Qt::endl;
133 CSamplesPerformance::parseWgs(number);
135 out <<
"Parse WGS coordinates " << number <<
" in " << ms <<
"ms" <<
Qt::endl;
140 CSamplesPerformance::copy10kStations(number);
142 out <<
"Copied 10k stations " << number <<
" times in " << ms <<
"ms" <<
Qt::endl;
146 CSamplesPerformance::copy10kStations(number);
148 out <<
"Copied 10k stations " << number <<
" times in " << ms <<
"ms" <<
Qt::endl;
156 std::generate_n(std::back_inserter(strList1), 100000, generator);
157 std::generate_n(std::back_inserter(strList2), 100000, generator);
158 std::generate_n(std::back_inserter(strList3), 100000, generator);
159 std::generate_n(std::back_inserter(strList4), 100000, generator);
165 for (
const auto &str : std::as_const(strList1))
170 out <<
"new regex matched " << number <<
" of" << strList1.
size() <<
" strings in " << ms <<
"ms" <<
Qt::endl;
173 for (
const auto &str : std::as_const(strList2))
178 out <<
"full regex matched " << number <<
" of" << strList2.
size() <<
" strings in " << ms <<
"ms" <<
Qt::endl;
181 for (
const auto &str : std::as_const(strList4))
183 if (str.contains(containsStr)) number++;
186 out <<
"contains matched " << number <<
" of " << strList4.
size() <<
" strings in " << ms <<
"ms" <<
Qt::endl;
188 out <<
"-----------------------------------------------" <<
Qt::endl;
199 qint64 halfTime = baseTimeEpoch + DeltaTime * numberOfTimes / 2;
203 for (
int cs = 0; cs < numberOfCallsigns; cs++)
209 out <<
"Reads by time, callsigns: " << timer.
elapsed() <<
"ms" <<
Qt::endl;
212 situationsBefore = situations.
findBefore(halfTime);
213 situationsAfter = situations.
findAfter(halfTime - 1);
214 for (
int cs = 0; cs < numberOfCallsigns; cs++)
219 Q_UNUSED(csSituationsBefore);
220 Q_UNUSED(csSituationsAfter);
222 out <<
"Split by time upfront, then callsigns: " << timer.
elapsed() <<
"ms" <<
Qt::endl;
223 int b = situationsBefore.
size();
224 int a = situationsAfter.
size();
225 Q_ASSERT(a + b == numberOfTimes * numberOfCallsigns);
231 out <<
"Split by " << csSituations.
size() <<
" callsigns, " << timer.
elapsed() <<
"ms" <<
Qt::endl;
238 a = csSituationsBefore.
size();
239 b = csSituationsAfter.
size();
240 Q_ASSERT(a + b == numberOfTimes);
241 Q_UNUSED(csSituationsBefore);
242 Q_UNUSED(csSituationsAfter);
244 out <<
"Split by callsign, by time: " << timer.
elapsed() <<
"ms" <<
Qt::endl;
253 auto situations = createSituations(0, 10000, 10);
254 auto models = createModels(10000, 100);
258 out <<
"Convert 100,000 aircraft situations to JSON: " << timer.
elapsed() <<
"ms" <<
Qt::endl;
261 situations.convertFromJson(json);
262 out <<
"Convert 100,000 aircraft situations from JSON: " << timer.
elapsed() <<
"ms" <<
Qt::endl
266 json = models.toJson();
267 out <<
"Convert 10,000 aircraft models to JSON (naive): " << timer.
elapsed() <<
"ms" <<
Qt::endl;
270 models.convertFromJson(json);
271 out <<
"Convert 10,000 aircraft models from JSON (naive): " << timer.
elapsed() <<
"ms" <<
Qt::endl
275 json = models.toMemoizedJson();
276 out <<
"Convert 10,000 aircraft models to JSON (memoize): " << timer.
elapsed() <<
"ms" <<
Qt::endl;
279 models.convertFromMemoizedJson(json);
280 out <<
"Convert 10,000 aircraft models from JSON (memoize): " << timer.
elapsed() <<
"ms" <<
Qt::endl
292 QFile modelFile(modelFileName);
293 [[maybe_unused]]
const bool existsModel = modelFile.
exists();
294 Q_ASSERT_X(existsModel, Q_FUNC_INFO,
"Model file does not exist");
295 QFile liveryFile(liveriesFileName);
296 [[maybe_unused]]
const bool existsLivery = liveryFile.
exists();
297 Q_ASSERT_X(existsLivery, Q_FUNC_INFO,
"Liveries file does not exist");
301 Q_ASSERT_X(!modelData.
isEmpty(), Q_FUNC_INFO,
"Model file empty");
305 Q_ASSERT_X(!liveryData.
isEmpty(), Q_FUNC_INFO,
"Livery file empty");
311 CDatabaseReader::stringToDatastoreResponse(liveryData, response);
315 out <<
"Read via DB JSON format: " << dbLiveries.
size() <<
" liveries in " << ms <<
"ms" <<
Qt::endl;
322 out <<
"Read via DB JSON format (new): " << dbLiveries2.
size() <<
" liveries in " << ms <<
"ms" <<
Qt::endl;
328 out <<
"Read via DB JSON format (new, passing airlines): " << dbLiveries3.
size() <<
" liveries in " << ms
331 CDatabaseReader::stringToDatastoreResponse(modelData, response);
335 out <<
"Read via DB JSON format: " << dbModels.
size() <<
" models in " << ms <<
"ms" <<
Qt::endl;
340 out <<
"Read via DB JSON format (new): " << dbModels2.
size() <<
" models in " << ms <<
"ms" <<
Qt::endl;
344 out <<
"Converted to swift JSON" <<
Qt::endl;
350 out <<
"Read via swift JSON format: " << swiftModels.
size() <<
" models in " << ms <<
"ms" <<
Qt::endl;
352 Q_ASSERT_X(swiftModels.
size() == dbModels.
size(), Q_FUNC_INFO,
"Mismatching container size");
360 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~_-=+!\"@#$%^&*()[]{} \t;:\\/?,.<>";
362 std::generate_n(std::back_inserter(strings), 100000, [] {
364 std::generate_n(std::back_inserter(s), 10,
374 for (
const QString &s : std::as_const(strings))
379 out <<
"Check 100,000 strings for containing uppercase letter: (utility) " << timer.
elapsed() <<
"ms"
383 for (
const QString &s : std::as_const(strings))
385 auto c = s.contains(upperRegex);
388 out <<
"Check 100,000 strings for containing uppercase letter: (regex) " << timer.
elapsed() <<
"ms"
393 for (
const QString &s : std::as_const(strings))
398 out <<
"Check 100,000 strings for index of first uppercase letter: (utility) " << timer.
elapsed() <<
"ms"
402 for (
const QString &s : std::as_const(strings))
404 auto i = s.indexOf(upperRegex);
407 out <<
"Check 100,000 strings for index of first uppercase letter: (regex) " << timer.
elapsed() <<
"ms"
417 out <<
"Remove from 100,000 strings all uppercase letters: (utility) " << timer.
elapsed() <<
"ms"
424 s.remove(upperRegex);
426 out <<
"Remove from 100,000 strings all uppercase letters: (regex) " << timer.
elapsed() <<
"ms"
435 out <<
"Split 100,000 line string into list of lines: (QStringList) " << timer.
elapsed() <<
"ms"
443 out <<
"Split 100,000 line string into list of lines: (QList<QStringView>) " << timer.
elapsed() <<
"ms"
451 const int loop = 250000;
453 const QString x1 =
"11-1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
454 const QString x2 =
"22-1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
455 const QString x3 =
"33-1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
456 const QString x4 =
"44-1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
457 const QString x5 =
"55-1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
458 const QString x6 =
"66-1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
459 const QString x7 =
"77-1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
460 const QString x8 =
"88-1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
461 const QString x9 =
"99-1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
465 for (
int i = 0; i < loop; i++)
467 x +=
"12-1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
473 for (
int i = 0; i < loop; i++)
475 x +=
QLatin1String(
"12-1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
481 for (
int i = 0; i < loop; i++)
483 x += QStringLiteral(
"12-1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
489 for (
int i = 0; i < loop; i++)
491 x = x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9;
497 for (
int i = 0; i < loop; i++)
499 x = x1 % x2 % x3 % x4 % x5 % x6 % x7 % x8 % x9;
505 for (
int i = 0; i < loop; i++)
509 out <<
"append String multiple " << time.
elapsed() <<
"ms" <<
Qt::endl;
512 static const QString xArgString(
"%1 %2 %3 %4 %5 %6 %7 %8 %9");
514 for (
int i = 0; i < loop; i++)
516 x = xArgString.
arg(x1, x2, x3, x4, x5, x6, x7, x8, x9);
522 for (
int i = 0; i < loop; i++)
524 x = QStringLiteral(
"%1 %2 %3 %4 %5 %6 %7 %8 %9").
arg(x1, x2, x3, x4, x5, x6, x7, x8, x9);
526 out <<
"arg QStringLiteral multiple " << time.
elapsed() <<
"ms" <<
Qt::endl;
534 const int loop = 1e7;
538 for (
int i = 0; i < loop; i++)
546 for (
int i = 0; i < loop; i++)
548 x = fooStringLiteral();
554 for (
int i = 0; i < loop; i++)
556 x =
QString(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. "
557 "Sed cursus ante dapibus diam. Sed nisi.");
563 for (
int i = 0; i < loop; i++)
565 x = QStringLiteral(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent "
566 "libero. Sed cursus ante dapibus diam. Sed nisi.");
568 out <<
"by QStringLiteral(\"...\") " << time.
elapsed() <<
"ms" <<
Qt::endl;
572 for (
int i = 0; i < loop; i++)
575 Q_UNUSED(foo.
size());
580 for (
int i = 0; i < loop; i++)
583 Q_UNUSED(foo.
size());
592 const CCallsignSet cs10 = CSamplesPerformance::callsigns(10);
593 const CCallsignSet cs25 = CSamplesPerformance::callsigns(25);
594 const CCallsignSet cs50 = CSamplesPerformance::callsigns(50);
604 Q_ASSERT(m10.
size() == 10 && h10.
size() == 10);
605 Q_ASSERT(m25.
size() == 25 && h25.
size() == 25);
606 Q_ASSERT(m50.
size() == 50 && h50.
size() == 50);
613 for (
int i = 0; i < 20; ++i)
620 Q_ASSERT(cs_10_100_rnd.
size() == 100);
621 Q_ASSERT(cs_25_100_rnd.
size() == 100);
622 Q_ASSERT(cs_50_100_rnd.
size() == 100);
626 for (
int i = 1; i < 10000; ++i)
628 for (
const CCallsign &cs : cs_10_100_rnd)
631 Q_ASSERT_X(s.
getCallsign() == cs, Q_FUNC_INFO,
"Wromg callsign");
637 for (
int i = 1; i < 10000; ++i)
639 for (
const CCallsign &cs : cs_10_100_rnd)
642 Q_ASSERT_X(s.
getCallsign() == cs, Q_FUNC_INFO,
"Wromg callsign");
648 for (
int i = 1; i < 10000; ++i)
650 for (
const CCallsign &cs : cs_25_100_rnd)
653 Q_ASSERT_X(s.
getCallsign() == cs, Q_FUNC_INFO,
"Wromg callsign");
659 for (
int i = 1; i < 10000; ++i)
661 for (
const CCallsign &cs : cs_25_100_rnd)
664 Q_ASSERT_X(s.
getCallsign() == cs, Q_FUNC_INFO,
"Wromg callsign");
670 for (
int i = 1; i < 10000; ++i)
672 for (
const CCallsign &cs : cs_50_100_rnd)
675 Q_ASSERT_X(s.
getCallsign() == cs, Q_FUNC_INFO,
"Wromg callsign");
681 for (
int i = 1; i < 10000; ++i)
683 for (
const CCallsign &cs : cs_50_100_rnd)
686 Q_ASSERT_X(s.
getCallsign() == cs, Q_FUNC_INFO,
"Wromg callsign");
698 for (
int cs = 0; cs < numberOfCallsigns; cs++)
702 for (
int t = 0; t < numberOfTimes; t++)
705 s.setMSecsSinceEpoch(baseTimeEpoch + DeltaTime * t);
712 CAircraftModelList CSamplesPerformance::createModels(
int numberOfModels,
int numberOfMemoParts)
714 CAircraftIcaoCodeList aircraftIcaos;
715 CLiveryList liveries;
716 CDistributorList distributors;
717 for (
int i = 0; i < numberOfMemoParts; ++i)
723 CAirlineIcaoCode(
"A" +
QString::number(i),
"Foo", CCountry(
"DE",
"Germany"),
"Foo",
false,
false),
724 "Foo",
"red",
"blue",
false));
728 CAircraftModelList models;
729 for (
int i = 0; i < numberOfModels; ++i)
741 void CSamplesPerformance::calculateDistance(
int n)
748 const QList<CCoordinateGeodetic> pos(
749 { CCoordinateGeodetic(10.0, 10.0, 10.0), CCoordinateGeodetic(20.0, 20.0, 20.0),
750 CCoordinateGeodetic(30.0, 30.0, 30.0), CCoordinateGeodetic(40.0, 40.0, 40.0),
751 CCoordinateGeodetic(50.0, 50.0, 50.0), CCoordinateGeodetic(60.0, 60.0, 60.0),
752 CCoordinateGeodetic(70.0, 70.0, 70.0) });
753 const qsizetype s = pos.size();
754 for (
int i = 0; i < n; i++)
756 const qsizetype p = i % s;
761 void CSamplesPerformance::copy10kStations(
int times)
763 CAtcStationList stations;
764 for (
int i = 0; i < times; i++)
766 stations = stations10k();
771 void CSamplesPerformance::parseWgs(
int times)
773 static QStringList wgsLatLng({
"12° 11′ 10″ N",
"11° 22′ 33″ W",
"48° 21′ 13″ N",
"11° 47′ 09″ E",
774 " 8° 21′ 13″ N",
"11° 47′ 09″ W",
"18° 21′ 13″ S",
"11° 47′ 09″ E",
775 "09° 12′ 13″ S",
"11° 47′ 09″ W" });
777 CCoordinateGeodetic c;
779 for (
int i = 0; i < times; i++)
781 int idx = (i % 5) * 2;
786 const QString &CSamplesPerformance::fooString()
788 static const QString s(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent "
789 "libero. Sed cursus ante dapibus diam. Sed nisi.");
793 QString CSamplesPerformance::fooStringLiteral()
795 return QStringLiteral(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent "
796 "libero. Sed cursus ante dapibus diam. Sed nisi.");
799 QStringList CSamplesPerformance::generateList() {
return QStringList({
"1",
"2",
"3",
"4" }); }
801 QStringList CSamplesPerformance::replacedList()
803 static const QStringList l({
"1",
"2",
"3",
"4" });
805 lc[1] = QStringLiteral(
"6");
806 lc[3] = QStringLiteral(
"7");
810 CCallsignSet CSamplesPerformance::callsigns(
int number)
813 static const QString cs(
"FOO%1");
814 for (
int i = 0; i < number; i++)
816 set.
insert(CCallsign(cs.arg(i)));
821 QMap<CCallsign, CAircraftSituation> CSamplesPerformance::situationsMap(
const CCallsignSet &callsigns)
823 QMap<CCallsign, CAircraftSituation> situations;
824 for (
const CCallsign &cs : callsigns)
826 const CAircraftSituation s(cs);
832 QHash<CCallsign, CAircraftSituation> CSamplesPerformance::situationsHash(
const CCallsignSet &callsigns)
834 QHash<CCallsign, CAircraftSituation> situations;
835 for (
const CCallsign &cs : callsigns)
837 const CAircraftSituation s(cs);
843 const CAtcStationList &CSamplesPerformance::stations10k()
849 void CSamplesPerformance::accessStationsData(
const CAtcStationList &stations,
bool byPropertyIndex)
851 for (
const CAtcStation &station : stations)
853 const QString s = CSamplesPerformance::accessStationData(station, byPropertyIndex);
858 QString CSamplesPerformance::accessStationData(
const CAtcStation &station,
bool byPropertyIndex)
863 r.
append(station.
propertyByIndex(CPropertyIndex { CAtcStation::IndexCallsign, CCallsign::IndexString })
865 r.
append(station.
propertyByIndex(CPropertyIndex { CAtcStation::IndexController, CUser::IndexRealName })
869 CPropertyIndex { CAtcStation::IndexPosition, CCoordinateGeodetic::IndexLatitudeAsString })
873 CPropertyIndex { CAtcStation::IndexPosition, CCoordinateGeodetic::IndexLongitudeAsString })
876 .propertyByIndex(CPropertyIndex { CAtcStation::IndexRelativeDistance,
877 CLength::IndexValueRounded2DigitsWithUnit })
iterator insert(const_iterator hint, const T &value)
For compatibility with std::inserter.
QList< T > toQList() const
Convert to a QList.
QJsonObject toJson() const
Cast to JSON object.
void convertFromJson(const QJsonObject &json)
Assign from JSON object.
static QString readFileToString(const QString &fileNameAndPath)
Read file into string.
Derived randomElements(int n) const
Copy n elements from the container at random.
size_type size() const
Returns number of elements in the sequence.
void sortBy(K1 key1, Keys... keys)
In-place sort by some particular key(s).
void pop_back()
Removes an element at the end of the sequence.
void push_back(const T &value)
Appends an element at the end of the sequence.
reference back()
Access the last element.
static const QString & staticDbFilesDirectory()
Where static DB files are located.
CONTAINER findAfter(const QDateTime &dateTime) const
List of objects after dateTime (newer).
CONTAINER findBefore(const QDateTime &dateTime) const
List of objects before dateTime (older).
Value object encapsulating information of an aircraft's situation.
const CCallsign & getCallsign() const
Corresponding callsign.
List of aircraft situations.
Value object encapsulating a list of ICAO codes.
const geo::CCoordinateGeodetic & getPosition() const
Get the position of the center of the controller's area of visibility.
QString getCallsignAsString() const
Get callsign as string.
const CCallsign & getCallsign() const
Get callsign.
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
const swift::misc::network::CUser & getController() const
Get controller.
const QDateTime & getLogoffTimeUtc() const
Return the expected logoff time (UTC). This data comes from the controller through its ATIS line.
Value object for a list of ATC stations.
Value object encapsulating information of a callsign.
Value object for a set of callsigns.
Value object for a list of airports.
CAirlineIcaoCodeList getAirlines() const
All aircraft codes.
static CLiveryList fromDatabaseJsonCaching(const QJsonArray &array, const CAirlineIcaoCodeList &relatedAirlines={})
Caching version from DB data.
CONTAINER findByCallsign(const CCallsign &callsign) const
Find 0..n stations by callsign.
QHash< CCallsign, CONTAINER > splitPerCallsign() const
Split into 0..n containers as per callsign.
static CLiveryList fromDatabaseJson(const QJsonArray &array)
static CCoordinateGeodetic fromWgs84(const QString &latitudeWgs84, const QString &longitudeWgs84, const aviation::CAltitude &geodeticHeight={})
Coordinate by WGS84 position data.
QString longitudeAsString() const
Longitude as string.
QString latitudeAsString() const
Latitude as string.
const physical_quantities::CLength & getRelativeDistance() const
Get the distance.
physical_quantities::CLength calculcateAndUpdateRelativeDistance(const geo::ICoordinateGeodetic &position)
Calculcate distance, set it, and return distance.
static QRandomGenerator & randomGenerator()
Thread-local random generator.
static int randomInteger(int low, int high)
Random number between low and high.
QString toQString(bool i18n=false) const
Cast as QString.
const QString & getRealName() const
Get full name.
static CLengthUnit m()
Meter m.
void setDistributor(const CDistributor &distributor)
Set distributor.
Value object encapsulating a list of aircraft models.
static CAircraftModelList fromDatabaseJsonCaching(const QJsonArray &array, const aviation::CAircraftIcaoCodeList &aircraftIcaos={}, const aviation::CAircraftCategoryList &aircraftCategories={}, const aviation::CLiveryList &liveries={}, const CDistributorList &distributors={})
Newer version.
static swift::misc::aviation::CAtcStation createStation(int index, bool byPropertyIndex=false)
Single station, annotated by index.
static swift::misc::aviation::CAtcStationList createAtcStations(int number, bool byPropertyIndex=false)
Generate number of ATC stations.
Classes interacting with the swift database (aka "datastore").
Generate data for testing purposes.
Free functions in swift::misc.
QString removeChars(const QString &s, F predicate)
Return a string with characters removed that match the given predicate.
int 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 QStringList splitLines(const QString &s)
Split a string into multiple lines. Blank lines are skipped.
SWIFT_MISC_EXPORT QList< QStringView > splitLinesRefs(const QString &s)
Split a string into multiple lines. Blank lines are skipped.
bool containsChar(const QString &s, F predicate)
True if any character in the string matches the given predicate.
bool isUpper(char32_t ucs4)
qint64 currentMSecsSinceEpoch()
QString toString(QStringView format) const const
QString filePath(const QString &fileName) const const
qint64 elapsed() const const
bool exists(const QString &fileName)
virtual QString fileName() const const override
QHash< Key, T >::iterator insert(Key &&key, T &&value)
qsizetype size() const const
void append(QList< T > &&value)
qsizetype size() const const
QMap< Key, T >::iterator insert(QMap< Key, T >::const_iterator pos, const Key &key, const T &value)
QMap< Key, T >::size_type size() const const
QRegularExpressionMatch match(QStringView subjectView, qsizetype offset, QRegularExpression::MatchType matchType, QRegularExpression::MatchOptions matchOptions) const const
void optimize() const const
bool hasMatch() const const
QString & append(QChar ch)
QString arg(Args &&... args) const const
bool isEmpty() const const
QString number(double n, char format, int precision)
qsizetype size() const const
QString join(QChar separator) const const
QTextStream & endl(QTextStream &stream)
QDateTime toDateTime() const const
QString toString() const const
Response from our database (depending on JSON DB backend generates).