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 validate_value(const item_value &value) const
Validate value value, throws if invalid.
-
bool validate_value(const item_value &value, std::error_code &ec) const noexcept
Validate value value and return potential error in ec.
-
bool validate_value(std::string_view value, std::error_code &ec) const noexcept
Validate value value and return potential error in ec.
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.
-
std::set<std::string> 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.
-
inline bool operator<(const item_validator &rhs) const