28 result =
copy(context);
32 result->set(
"comment", comment);
43 for (
ElementPtr const& item : list->listValue()) {
45 if (item->contains(name)) {
48 item->set(name, param);
57 for (
ElementPtr const& item : list->listValue()) {
60 param = item->get(name);
61 }
else if ((!param && item->contains(name)) ||
62 (param && !item->contains(name)) ||
63 (param && item->contains(name) &&
64 !param->equals(*item->get(name)))) {
66 "inconsistent value of " << name
67 <<
" in " << list->str());
70 if (!first && param) {
71 for (
ElementPtr const& item : list->listValue()) {
76 parent->set(name, param);
99 string name = key->stringValue();
100 if (!name.empty() && !scope->contains(name)) {
101 scope->set(name,
copy(value));
105 scope->add(
copy(value));
124 string name = key->stringValue();
126 scope->set(name,
copy(value));
147 string name = key->stringValue();
155 int index = key->intValue();
156 if ((index >= 0) && (index < scope->size())) {
157 scope->remove(index);
165 string name = entry->stringValue();
169 for (
int i = 0; i < scope->size(); ++i) {
175 if (compare && value->equals(*compare)) {
193 if (next == actions->size()) {
199 !action->contains(
"action")) {
200 applyAction(actions, scope, next);
203 string name = action->get(
"action")->stringValue();
204 if (name ==
"insert") {
205 applyInsert(action->get(
"key"), action->get(
"value"), scope);
206 }
else if (name ==
"replace") {
207 applyReplace(action->get(
"key"), action->get(
"value"), scope);
208 }
else if (name ==
"delete") {
209 applyDelete(action->get(
"key"), scope);
211 applyAction(actions, scope, next);
233 if (next == path->size()) {
234 applyAction(actions, scope, 0);
243 string name = step->stringValue();
244 if (name.empty() || !scope->contains(name)) {
250 applyDown(path, actions, mutable_down, next);
251 scope->set(name, mutable_down);
257 auto downs = scope->listValue();
264 string name = key->stringValue();
273 if (compare && value->equals(*compare)) {
274 applyDown(path, actions, down, next);
281 int index = step->intValue();
284 applyDown(path, actions, down, next);
286 }
else if ((index >= 0) && (index < scope->size())) {
287 applyDown(path, actions, scope->getNonConst(index), next);
298 applyDown(path, actions, config, 0);
static void fromParent(const std::string &name, isc::data::ConstElementPtr parent, isc::data::ConstElementPtr list)
Moves a parameter from parent to a list of children.
static void modify(isc::data::ConstElementPtr path, isc::data::ConstElementPtr actions, isc::data::ElementPtr config)
Modify a configuration in its JSON element format.