MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / Section

Method Section

launcher/Version.h:65–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63 private:
64 struct Section {
65 explicit Section(QString fullString) : m_fullString(std::move(fullString))
66 {
67 qsizetype cutoff = m_fullString.size();
68 for (int i = 0; i < m_fullString.size(); i++) {
69 if (!m_fullString[i].isDigit()) {
70 cutoff = i;
71 break;
72 }
73 }
74
75#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
76 auto numPart = QStringView{ m_fullString }.left(cutoff);
77#else
78 auto numPart = m_fullString.leftRef(cutoff);
79#endif
80
81 if (!numPart.isEmpty()) {
82 m_isNull = false;
83 m_numPart = numPart.toInt();
84 }
85
86#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
87 auto stringPart = QStringView{ m_fullString }.mid(cutoff);
88#else
89 auto stringPart = m_fullString.midRef(cutoff);
90#endif
91
92 if (!stringPart.isEmpty()) {
93 m_isNull = false;
94 m_stringPart = stringPart.toString();
95 }
96 }
97
98 explicit Section() = default;
99

Callers

nothing calls this directly

Calls 5

moveFunction · 0.85
isDigitMethod · 0.80
sizeMethod · 0.45
isEmptyMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected