userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
convert.cpp
1
#
include
<
userver
/
protobuf
/
json
/
convert
.
hpp
>
2
3
#
include
<
userver
/
formats
/
json
/
serialize
.
hpp
>
4
5
#
include
<
protobuf
/
json
/
impl
/
read
.
hpp
>
6
#
include
<
protobuf
/
json
/
impl
/
write
.
hpp
>
7
#
include
<
protobuf
/
json
/
impl
/
write_debug_string
.
hpp
>
8
#
include
<
protobuf
/
json
/
impl
/
write_json_string
.
hpp
>
9
10
USERVER_NAMESPACE_BEGIN
11
12
namespace
protobuf::json {
13
14
formats::
json
::ValueBuilder MessageToJsonBuilder(
15
const
::google::protobuf::Message& message,
16
const
PrintOptions
& options
17
) {
18
return
impl::WriteMessage(message, options);
19
}
20
21
void
JsonToMessage(
22
const
formats::
json
::
Value
& json,
23
::google::protobuf::Message& message,
24
const
ParseOptions
& options
25
) {
26
impl::ReadMessage(json, message, options);
27
}
28
29
void
JsonStringToMessage(
30
std::string_view json_string,
31
::google::protobuf::Message& message,
32
const
ParseOptions
& options
33
) {
34
JsonToMessage(formats
::
json
::
FromString
(
json_string
)
, message, options);
35
}
36
37
std::string MessageToJsonString(
const
::google::protobuf::Message& message,
const
PrintOptions
& options) {
38
return
impl::WriteMessageToJsonString(message, options);
39
}
40
41
std::string MessageToDebugString(
const
::google::protobuf::Message& message, std::size_t limit) {
42
return
impl::WriteMessageToDebugString(message, limit);
43
}
44
45
}
// namespace protobuf::json
46
47
namespace
formats::
serialize
{
48
49
json
::
Value
Serialize(
const
::google::protobuf::Message& message,
To
<
json
::
Value
>) {
50
return
protobuf::json::MessageToJson(message);
51
}
52
53
}
// namespace formats::serialize
54
55
USERVER_NAMESPACE_END
protobuf
src
protobuf
json
convert.cpp
Generated on
for userver by
Doxygen
1.17.0