Class validator
Defined in File validate.hpp
Class Documentation
-
class validator
The validator class combines all the link, category and item validator classes.
Public Functions
-
inline validator(std::string_view name)
Construct a new validator object.
- Parameters
name – The name of the underlying dictionary
-
~validator() = default
destructor
-
void add_type_validator(type_validator &&v)
Add type_validator v to the list of type validators.
-
const type_validator *get_validator_for_type(std::string_view type_code) const
Return the type validator for type_code, may return nullptr.
-
void add_category_validator(category_validator &&v)
Add category_validator v to the list of category validators.
-
const category_validator *get_validator_for_category(std::string_view category) const
Return the category validator for category, may return nullptr.
-
void add_link_validator(link_validator &&v)
Add link_validator v to the list of link validators.
-
std::vector<const link_validator*> get_links_for_parent(std::string_view category) const
Return the list of link validators for which the parent is category.
-
std::vector<const link_validator*> get_links_for_child(std::string_view category) const
Return the list of link validators for which the child is category.
-
void report_error(const std::string &msg, bool fatal) const
Bottleneck function to report an error in validation.
-
inline const std::string &name() const
Get the name of this validator.
-
inline void set_name(const std::string &name)
Set the name of this validator.
-
inline const std::string &version() const
Get the version of this validator.
-
inline void set_version(const std::string &version)
Set the version of this validator.
Friends
- friend class dictionary_parser
-
inline validator(std::string_view name)