Context in which constraints are checked.
More...
template<typename X>
struct anch::val::CheckContext< X >
Context in which constraints are checked.
Formats specialize it for their contexts (anch-json: reader and writer contexts) ; anch-val specializes it for anch::val::ValidationContext . A specialization defines:
- static bool enabled(const X& context) : constraints have to be checked (format options) ;
- static void violation(X& context, const std::string& message) : report a violation on the current value (a format raises its error, a validation collects violations and goes on) ;
- template<typename F> static void item(X& context, std::string_view key, F&& check) and template<typename F> static void item(X& context, std::size_t index, F&& check) : check a map value or a collection item (anch::val::Items ), the key or the index is part of the violation path.
- Template Parameters
-
- Since
- 0.3
The documentation for this struct was generated from the following file: