| 681 | } |
| 682 | |
| 683 | Json::Value cmFileAPI::BuildClientReply(ClientQuery const& q) |
| 684 | { |
| 685 | Json::Value reply = this->BuildReply(q.DirQuery); |
| 686 | |
| 687 | if (!q.HaveQueryJson) { |
| 688 | return reply; |
| 689 | } |
| 690 | |
| 691 | Json::Value& reply_query_json = reply["query.json"]; |
| 692 | ClientQueryJson const& qj = q.QueryJson; |
| 693 | |
| 694 | if (!qj.Error.empty()) { |
| 695 | reply_query_json = this->BuildReplyError(qj.Error); |
| 696 | return reply; |
| 697 | } |
| 698 | |
| 699 | if (!qj.ClientValue.isNull()) { |
| 700 | reply_query_json["client"] = qj.ClientValue; |
| 701 | } |
| 702 | |
| 703 | if (!qj.RequestsValue.isNull()) { |
| 704 | reply_query_json["requests"] = qj.RequestsValue; |
| 705 | } |
| 706 | |
| 707 | reply_query_json["responses"] = this->BuildClientReplyResponses(qj.Requests); |
| 708 | |
| 709 | return reply; |
| 710 | } |
| 711 | |
| 712 | Json::Value cmFileAPI::BuildClientReplyResponses( |
| 713 | ClientRequests const& requests) |
no test coverage detected