| 408 | } |
| 409 | |
| 410 | void cmFileAPI::ReadClientQuery(std::string const& client, ClientQueryJson& q) |
| 411 | { |
| 412 | // Read the query.json file. |
| 413 | std::string queryFile = |
| 414 | cmStrCat(this->APIv1, "/query/", client, "/query.json"); |
| 415 | Json::Value query; |
| 416 | if (!this->ReadJsonFile(queryFile, query, q.Error)) { |
| 417 | return; |
| 418 | } |
| 419 | if (!query.isObject()) { |
| 420 | q.Error = "query root is not an object"; |
| 421 | return; |
| 422 | } |
| 423 | |
| 424 | Json::Value const& clientValue = query["client"]; |
| 425 | if (!clientValue.isNull()) { |
| 426 | q.ClientValue = clientValue; |
| 427 | } |
| 428 | q.RequestsValue = std::move(query["requests"]); |
| 429 | q.Requests = this->BuildClientRequests(q.RequestsValue); |
| 430 | } |
| 431 | |
| 432 | Json::Value cmFileAPI::BuildReplyIndex() |
| 433 | { |
no test coverage detected