# Struct item_validator

- Defined in File validate.hpp

## Struct Documentation

struct item_validator

  An item_validator binds a type_validator to an item in a category along with other information found in the dictionary.

  mmCIF dictionaries may indicate an item is e.g. mandatory or consists of a certain list of allowed values. Even default values can be provided.

  Public Functions

  inline bool operator<(const item_validator &rhs) const

    Compare based on the name.

  inline bool operator==(const item_validator &rhs) const

    Compare based on the name.

  void operator()(std::string_view value) const

    Validate the value in value for this item Will throw a std::system_error exception if it fails.

  bool validate_value(std::string_view value, std::error_code &ec) const noexcept

    A more gentle version of value validation.

  Public Members

  std::string m_item_name

    The item name.

  bool m_mandatory

    Flag indicating this item is mandatory.

  const type_validator *m_type

    The type for this item.

  cif::iset m_enums

    If filled, the set of allowed values.

  std::string m_default

    If filled, a default value for this item.

  std::string m_category

    The category this item_validator belongs to.

  std::vector<item_alias> m_aliases

    The aliases for this item.