14namespace gemmi {
namespace cif {
21 bool print_unknown_tags =
true;
23 bool use_regex =
true;
24 bool use_context =
false;
25 bool use_parents =
false;
26 bool use_mandatory =
true;
27 bool use_unique_keys =
true;
30 bool use_deposition_checks =
false;
33 int major_version = 0;
51 const std::map<std::string, std::regex>&
regexes()
const {
return regexes_; }
57 std::vector<std::string> child_tags;
58 std::vector<std::string> parent_tags;
61 std::vector<std::unique_ptr<cif::Document>> ddl_docs_;
62 std::map<std::string, cif::Block*> name_index_;
63 std::map<std::string, std::regex> regexes_;
64 std::vector<ParentLink> parents_;
66 std::map<std::string, std::string> item_parents_;
68 cif::Block* find_rules(
const std::string& name)
const {
70 return iter != name_index_.end() ?
iter->second :
nullptr;
72 void check_mandatory_items(
const cif::Block& b)
const;
73 void check_unique_keys_in_loop(
const cif::Loop& loop,
const cif::Block& block)
const;
74 void check_parents(
const cif::Block& b)
const;
75 void check_parent_link(
const ParentLink& link,
const cif::Block& b)
const;
76 void read_ddl1_block(cif::Block& block);
77 void read_ddl2_block(cif::Block& block);
79 template<
class... Args>
void warn(
const cif::Block& b, Args
const&... args)
const {
80 logger.
level<3>(
'[', b.name,
"] ", args...);
struct Document that represents the CIF file (but can also be read from a different representation,...
Logger - a tiny utility for passing messages through a callback.
std::string to_lower(std::string str)
Passes messages (including warnings/errors) to a callback function.
void level(Args const &... args) const
Send a message without any prefix on with a numeric threshold N.
Represents DDL1 or DDL2 dictionary (ontology).
bool validate_block(const cif::Block &b, const std::string &source) const
bool validate_cif(const cif::Document &doc) const
Ddl & operator=(Ddl const &)=delete
void read_ddl(cif::Document &&doc)
it moves doc to ddl_docs_ to control lifetime and prevent modifications
void check_audit_conform(const cif::Document &doc) const
Logger logger
member functions use logger's callback and threshold for output
const std::map< std::string, std::regex > & regexes() const