MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / Serialize

Method Serialize

cpp/webdriver-server/response.cc:59–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59std::string Response::Serialize(void) {
60 LOG(TRACE) << "Entering Response::Serialize";
61
62 Json::Value json_object;
63 if (this->error_.size() > 0) {
64 Json::Value error_object;
65 error_object["error"] = this->error_;
66 error_object["message"] = this->value_.asString();
67 error_object["stacktrace"] = "";
68 if (!this->value_.isNull() && !this->additional_data_.isNull()) {
69 error_object["data"] = this->additional_data_;
70 }
71 json_object["value"] = error_object;
72 } else {
73 json_object["value"] = this->value_;
74 }
75 Json::StreamWriterBuilder writer;
76 std::string output(Json::writeString(writer, json_object));
77 return output;
78}
79
80void Response::SetSuccessResponse(const Json::Value& response_value) {
81 LOG(TRACE) << "Entering Response::SetSuccessResponse";

Callers

nothing calls this directly

Calls 3

isNullMethod · 0.80
LOGClass · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected