diff options
Diffstat (limited to 'src/components/formatters/src/formatter_json_rpc.cc')
-rw-r--r-- | src/components/formatters/src/formatter_json_rpc.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/components/formatters/src/formatter_json_rpc.cc b/src/components/formatters/src/formatter_json_rpc.cc index e349ced4d6..f445aff85b 100644 --- a/src/components/formatters/src/formatter_json_rpc.cc +++ b/src/components/formatters/src/formatter_json_rpc.cc @@ -58,14 +58,15 @@ const char* FormatterJsonRpc::kMessage = "message"; bool FormatterJsonRpc::ToString(const NsSmartObjects::SmartObject& obj, std::string& out_str) { + using namespace utils::json; bool result = true; try { - Json::Value root(Json::objectValue); + JsonValue root(ValueType::OBJECT_VALUE); root[kJsonRpc] = kJsonRpcExpectedValue; NsSmartObjects::SmartObject formatted_object(obj); - Json::Value msg_params_json(Json::objectValue); + JsonValue msg_params_json(ValueType::OBJECT_VALUE); formatted_object.getSchema().unapplySchema(formatted_object); bool is_message_params = formatted_object.keyExists(strings::S_MSG_PARAMS); @@ -143,7 +144,7 @@ bool FormatterJsonRpc::ToString(const NsSmartObjects::SmartObject& obj, } } } - out_str = root.toStyledString(); + out_str = root.ToJson(); } catch (...) { result = false; } @@ -152,7 +153,7 @@ bool FormatterJsonRpc::ToString(const NsSmartObjects::SmartObject& obj, } bool FormatterJsonRpc::SetMethod(const NsSmartObjects::SmartObject& params, - Json::Value& method_container) { + utils::json::JsonValueRef method_container) { bool result = false; if (true == params.keyExists(strings::S_FUNCTION_ID)) { @@ -169,7 +170,7 @@ bool FormatterJsonRpc::SetMethod(const NsSmartObjects::SmartObject& params, } bool FormatterJsonRpc::SetId(const NsSmartObjects::SmartObject& params, - Json::Value& id_container) { + utils::json::JsonValueRef id_container) { bool result = false; if (true == params.keyExists(strings::S_CORRELATION_ID)) { @@ -186,7 +187,7 @@ bool FormatterJsonRpc::SetId(const NsSmartObjects::SmartObject& params, } bool FormatterJsonRpc::SetMessage(const NsSmartObjects::SmartObject& params, - Json::Value& message_container) { + utils::json::JsonValueRef message_container) { bool result = false; if (true == params.keyExists(strings::kMessage)) { |