JSON Voorhees
Killer JSON for C++
jsonv::merge_rules Class Referenceabstract

This class is used in merge_explicit for defining what the function should do in the cases of conflicts. More...

#include <jsonv/algorithm.hpp>

+ Inheritance diagram for jsonv::merge_rules:

Public Member Functions

virtual value resolve_same_key (path &&current_path, value &&a, value &&b) const =0
 Called when merging a kind::object and the two objects share a key. More...
 
virtual value resolve_type_conflict (path &&current_path, value &&a, value &&b) const =0
 Called when a and b have kind values which are incompatible for merging. More...
 

Detailed Description

This class is used in merge_explicit for defining what the function should do in the cases of conflicts.

Definition at line 277 of file algorithm.hpp.

Member Function Documentation

virtual value jsonv::merge_rules::resolve_same_key ( path &&  current_path,
value &&  a,
value &&  b 
) const
pure virtual

Called when merging a kind::object and the two objects share a key.

The implementation can either throw or merge the keys.

Parameters
current_pathis the merge path with the key that conflicted appended.
ais the left-hand value to merge.
bis the right-hand value to merge.

Implemented in jsonv::recursive_merge_rules, jsonv::throwing_merge_rules, and jsonv::dynamic_merge_rules.

virtual value jsonv::merge_rules::resolve_type_conflict ( path &&  current_path,
value &&  a,
value &&  b 
) const
pure virtual

Called when a and b have kind values which are incompatible for merging.

The implementation can either throw or coerce a merge.

Parameters
current_pathpath with the conflicting kind values.
ais the left-hand value to merge.
bis the right-hand value to merge.

Implemented in jsonv::recursive_merge_rules, jsonv::throwing_merge_rules, and jsonv::dynamic_merge_rules.


The documentation for this class was generated from the following file: