userver: /data/code/userver/libraries/protobuf/src/protobuf/json/convert.cpp Source File
Loading...
Searching...
No Matches
convert.cpp
1#include <userver/protobuf/json/convert.hpp>
2
3#include <protobuf/json/impl/read.hpp>
4#include <protobuf/json/impl/write.hpp>
5
6USERVER_NAMESPACE_BEGIN
7
8namespace protobuf::json {
9
10formats::json::ValueBuilder MessageToJsonBuilder(
11 const ::google::protobuf::Message& message,
12 const PrintOptions& options
13) {
14 return impl::WriteMessage(message, options);
15}
16
17void JsonToMessage(
18 const formats::json::Value& json,
19 ::google::protobuf::Message& message,
20 const ParseOptions& options
21) {
22 impl::ReadMessage(json, message, options);
23}
24
25} // namespace protobuf::json
26
27/*
28namespace formats::serialize {
29
30json::Value Serialize(const ::google::protobuf::Message& message, To<json::Value>) {
31 return protobuf::json::MessageToJson(message);
32}
33
34} // namespace formats::serialize
35*/
36
37USERVER_NAMESPACE_END