56 virtual void open_tag(
const std::string& name,
const config& parent,
int start_line = 0,
const std::string& file =
"",
bool addition =
false)
override;
58 virtual void validate(
const config& cfg,
const std::string& name,
int start_line,
const std::string& file)
override;
74 typedef std::map<std::string, counter>
cnt_map;
103 message_info(
message_type t,
const std::string& file,
int line = 0,
int n = 0,
const std::string& tag =
"",
const std::string& key =
"",
const std::string& value =
"",
const std::string& expected =
"")
149 template<
typename... T>
152 cache_.top()[&cfg].emplace_back(std::forward<T>(args)...);
168 virtual void open_tag(
const std::string& name,
const config& parent,
int start_line = 0,
const std::string& file =
"",
bool addition =
false)
override;
170 virtual void validate(
const config& cfg,
const std::string& name,
int start_line,
const std::string& file)
override;
174 reference(
const std::string& value,
const std::string& file,
int line,
const std::string& tag)
182 bool match(
const std::set<std::string>& with);
186 std::string current_path()
const;
190 std::map<std::string, std::string>
links_;
194 void check_for_duplicates(
const std::string& name, std::vector<std::string>& seen,
const config& cfg,
message_type type,
const std::string& file,
int line,
const std::string& tag);
195 static bool name_matches(
const std::string& pattern,
const std::string& name);
std::set< std::string > defined_types_
std::stack< cnt_map > cnt_stack
And counter maps are organize in stack.
std::stack< const wml_tag * > stack_
bool create_exceptions_
Controls the way to print errors.
cnt_stack counter_
Contains number of children.
This file contains object "type", which is used to store information about types while annotation par...
std::multimap< std::string, std::string > derivations_
Variant for storing WML attributes.
Stores information about tag.
std::deque< message_info > message_list
This file contains information about validation abstract level interface.
std::map< const config *, message_list > message_map
wml_tag root_
Root of schema information.
std::map< std::string, ptr > map
bool config_read_
Shows, if validator is initialized with schema file.
This file contains object "tag", which is used to store information about tags while annotation parsi...
Used in parsing config file.
std::stack< message_map > cache_
Caches error messages.
virtual void validate_key(const config &cfg, const std::string &name, const config_attribute_value &value, int start_line, const std::string &file) override
Checks if key is allowed and if its value is valid What exactly is validated depends on validator rea...
wml_type::map types_
Type validators.
message_info(message_type t, const std::string &file, int line=0, int n=0, const std::string &tag="", const std::string &key="", const std::string &value="", const std::string &expected="")
std::stack< std::string > tag_stack_
schema_validator(const std::string &filename, bool validate_schema=false)
Initializes validator from file.
std::vector< reference > referenced_types_
void line(int from_x, int from_y, int to_x, int to_y)
Draw a line.
bool read_config_file(const std::string &filename)
Reads config from input.
static bool operator<(const placing_info &a, const placing_info &b)
const wml_tag & active_tag() const
virtual void close_tag() override
As far as parser is built on stack, some realizations can store stack too.
std::shared_ptr< wml_type > ptr
bool have_active_tag() const
std::string active_tag_path() const
void queue_message(const config &cfg, T &&... args)
This file contains object "key", which is used to store information about keys while annotation parsi...
virtual void open_tag(const std::string &name, const config &parent, int start_line=0, const std::string &file="", bool addition=false) override
Is called when parser opens tag.
Realization of serialization/validator.hpp abstract validator.
virtual ~schema_validator()
void set_create_exceptions(bool value)
wml_type::ptr find_type(const std::string &type) const
std::map< std::string, counter > cnt_map
Counters are mapped by tag name.
A config object defines a single node in a WML file, with access to child nodes.
reference(const std::string &value, const std::string &file, int line, const std::string &tag)
virtual void print(message_info &)
virtual void validate(const config &cfg, const std::string &name, int start_line, const std::string &file) override
Validates config.
std::map< std::string, std::string > links_