15 #ifndef SCHEMA_VALIDATOR_HPP
16 #define SCHEMA_VALIDATOR_HPP
26 #include <boost/regex.hpp>
58 bool addittion =
false);
79 typedef std::map<std::string,counter>
cnt_map;
113 :type(t),file(file),line(line),n(n),tag(tag),key(key),
149 std::map<std::string,boost::regex>
types_;
153 #endif // SCHEMA_VALIDATOR_HPP
std::stack< cnt_map > cnt_stack
And counter maps are organize in stack.
bool create_exceptions_
Controls the way to print errors.
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="")
cnt_stack counter_
Contains number of children.
virtual void close_tag()
As far as parser is built on stack, some realizations can store stack too.
virtual void validate(const config &cfg, const std::string &name, int start_line, const std::string &file)
Validates config.
std::deque< message_info > message_list
std::map< std::string, boost::regex > types_
Type validators.
std::map< const config *, message_list > message_map
This file contains information about validation abstract level interface.
bool config_read_
Shows, if validator is intialized with schema file;.
class_tag root_
Root of schema information.
This file contains objects "tag" and "key", which are used to store information about tags and keys w...
Used in parsing config file.
std::stack< message_map > cache_
Caches error messages.
schema_validator(const std::string &filename)
Initializes validator from file.
GLsizei const GLfloat * value
virtual void validate_key(const config &cfg, const std::string &name, const std::string &value, int start_line, const std::string &file)
Checks if key is allowed and if its value is valid What exactly is validated depends on validator rea...
virtual void open_tag(const std::string &name, int start_line=0, const std::string &file="", bool addittion=false)
Is called when parser opens tag.
std::map< std::string, counter > cnt_map
Counters are mapped by tag name.
bool read_config_file(const std::string &filename)
Reads config from input.
std::stack< const class_tag * > stack_
GLuint const GLchar * name
Realization of serialization/validator.hpp abstract validator.
virtual ~schema_validator()
void set_create_exceptions(bool value)
A config object defines a single node in a WML file, with access to child nodes.
GLsizei const GLcharARB ** string
void print(message_info &)
Stores information about tag.