6 #include <QCoreApplication>
25 using namespace swift::sample;
29 int main(
int argc,
char *argv[])
33 QCoreApplication qa(argc, argv);
37 QTextStream qtout(stdout);
38 QTextStream qtin(stdin);
42 qtout <<
"1 .. JSON" << Qt::endl;
43 qtout <<
"2 .. Change object" << Qt::endl;
44 qtout <<
"3a .. Containers" << Qt::endl;
45 qtout <<
"3b .. Callsign QMap vs QHash" << Qt::endl;
46 qtout <<
"4 .. Metadata" << Qt::endl;
47 qtout <<
"6a .. Performance create / copy / ..." << Qt::endl;
48 qtout <<
"6b .. 40/20 Interpolator scenario" << Qt::endl;
49 qtout <<
"6c .. JSON performance" << Qt::endl;
50 qtout <<
"6d .. JSON model performance (database vs. own JSON)" << Qt::endl;
51 qtout <<
"6e .. string utils vs.regex" << Qt::endl;
52 qtout <<
"6f .. string concatenation (+=, arg, ..)" << Qt::endl;
53 qtout <<
"6g .. const &QString vs. QStringLiteral" << Qt::endl;
54 qtout <<
"7 .. Algorithms" << Qt::endl;
55 qtout <<
"8 .. File/Directory" << Qt::endl;
56 qtout <<
"-----" << Qt::endl;
57 qtout <<
"x .. Bye" << Qt::endl;
58 const QString s = qtin.readLine().toLower().trimmed();
60 if (s.startsWith(
"1")) { CSamplesJson::samples(); }
61 else if (s.startsWith(
"2")) { CSamplesChangeObject::samples(); }
62 else if (s.startsWith(
"3a")) { CSamplesContainer::samples(); }
63 else if (s.startsWith(
"3b")) { CSamplesPerformance::sampleQMapVsQHashByCallsign(qtout); }
64 else if (s.startsWith(
"4")) { CSamplesMetadata::samples(); }
65 else if (s.startsWith(
"6a")) { CSamplesPerformance::samplesMisc(qtout); }
66 else if (s.startsWith(
"6b")) { CSamplesPerformance::interpolatorScenario(qtout, 40, 20); }
67 else if (s.startsWith(
"6c")) { CSamplesPerformance::samplesJson(qtout); }
68 else if (s.startsWith(
"6d")) { CSamplesPerformance::samplesJsonModelAndLivery(qtout); }
69 else if (s.startsWith(
"6e")) { CSamplesPerformance::samplesStringUtilsVsRegEx(qtout); }
70 else if (s.startsWith(
"6f")) { CSamplesPerformance::samplesStringConcat(qtout); }
71 else if (s.startsWith(
"6g")) { CSamplesPerformance::samplesStringLiteralVsConstQString(qtout); }
72 else if (s.startsWith(
"7")) { CSamplesAlgorithm::samples(); }
73 else if (s.startsWith(
"8")) { CSamplesFile::samples(qtout); }
74 else if (s.startsWith(
"x")) {
break; }
Backend services of the swift project, like dealing with the network or the simulators.
Free functions in swift::misc.
int main(int argc, char *argv[])
main