Validation context. More...
#include <constraints.hpp>
Public Member Functions | |
| void | enter (std::string_view field) |
| void | enter (std::size_t index) |
| void | leave () |
| void | add (const std::string &message) |
| std::vector< anch::val::Violation > & | violations () |
Validation context.
Context used by validations ( anch::val::validate ) : it keeps the path of the checked value and collects violations.
| void anch::val::ValidationContext::add | ( | const std::string & | message | ) |
Add violation on the current value
| message | the violation message |
| void anch::val::ValidationContext::enter | ( | std::size_t | index | ) |
Enter array item
| index | the item index |
| void anch::val::ValidationContext::enter | ( | std::string_view | field | ) |
Enter object field or map entry
| field | the field name or map key |
| void anch::val::ValidationContext::leave | ( | ) |
Leave the current field or item
| std::vector< anch::val::Violation > & anch::val::ValidationContext::violations | ( | ) |
Collected violations getter