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

Function read_lock_File

launcher/Application.cpp:189–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187} // namespace
188
189std::tuple<QDateTime, QString, QString, QString, QString> read_lock_File(const QString& path)
190{
191 auto contents = QString(FS::read(path));
192 auto lines = contents.split('\n');
193
194 QDateTime timestamp;
195 QString from, to, target, data_path;
196 for (auto line : lines) {
197 auto index = line.indexOf("=");
198 if (index < 0)
199 continue;
200 auto left = line.left(index);
201 auto right = line.mid(index + 1);
202 if (left.toLower() == "timestamp") {
203 timestamp = QDateTime::fromString(right, Qt::ISODate);
204 } else if (left.toLower() == "from") {
205 from = right;
206 } else if (left.toLower() == "to") {
207 to = right;
208 } else if (left.toLower() == "target") {
209 target = right;
210 } else if (left.toLower() == "data_path") {
211 data_path = right;
212 }
213 }
214 return std::make_tuple(timestamp, from, to, target, data_path);
215}
216
217Application::Application(int& argc, char** argv) : QApplication(argc, argv)
218{

Callers 1

ApplicationMethod · 0.70

Calls 2

QStringClass · 0.85
readFunction · 0.85

Tested by

no test coverage detected