| 237 | } |
| 238 | |
| 239 | void Contest::writeToJson(QJsonObject &out) { |
| 240 | QString version = "1.0"; |
| 241 | |
| 242 | WRITE_JSON(out, version); |
| 243 | |
| 244 | WRITE_JSON(out, contestTitle); |
| 245 | |
| 246 | QJsonArray tasks; |
| 247 | |
| 248 | for (const auto &i : taskList) { |
| 249 | QJsonObject obj; |
| 250 | i->writeToJson(obj); |
| 251 | tasks.append(obj); |
| 252 | } |
| 253 | |
| 254 | WRITE_JSON(out, tasks); |
| 255 | |
| 256 | QJsonArray contestants; |
| 257 | |
| 258 | for (const auto &i : contestantList) { |
| 259 | QJsonObject obj; |
| 260 | i->writeToJson(obj); |
| 261 | contestants.append(obj); |
| 262 | } |
| 263 | |
| 264 | WRITE_JSON(out, contestants); |
| 265 | } |
| 266 | int Contest::readFromJson(const QJsonObject &in) { |
| 267 | QString version; |
| 268 |
nothing calls this directly
no outgoing calls
no test coverage detected