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
11 const ::google::protobuf::Message& message,
12 const WriteOptions& options
13) {
14 return impl::WriteMessage(message, options);
15}
16
17void JsonToMessage(const formats::json::Value& json, const ReadOptions& options, ::google::protobuf::Message& message) {
18 impl::ReadMessage(json, options, message);
19}
20
21} // namespace protobuf::json
22
23namespace formats::serialize {
24
25json::Value Serialize(const ::google::protobuf::Message& message, To<json::Value>) {
26 return protobuf::json::MessageToJson(message);
27}
28
29} // namespace formats::serialize
30USERVER_NAMESPACE_END