Class validator

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

validator(const validator &rhs) = delete
validator &operator=(const validator &rhs) = delete
validator(validator &&rhs) = default

move constructor

validator &operator=(validator &&rhs) = default

move assignment operator

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.

Add link_validator v to the list of link validators.

Return the list of link validators for which the parent is category.

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