userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
merge.hpp
Go to the documentation of this file.
1
#pragma once
2
6
7
#include <
userver/formats/common/items.hpp
>
8
9
USERVER_NAMESPACE_BEGIN
10
11
namespace
formats::common
{
12
17
template
<
typename
Value>
18
void
Merge
(
typename
Value::Builder& original,
const
Value& patch) {
19
if
(patch.IsObject() && original.IsObject() && !original.IsEmpty()) {
20
for
(
const
auto
& [elem_key, elem_value] :
common::Items
(patch)) {
21
auto
next_origin = original[elem_key];
22
common::Merge
(next_origin, elem_value);
23
}
24
}
else
if
(!patch.IsMissing()) {
25
original = patch;
26
}
27
}
28
29
}
// namespace formats::common
30
31
USERVER_NAMESPACE_END
userver
formats
common
merge.hpp
Generated on
for userver by
Doxygen
1.17.0