21 #ifndef TOOLS_SCHEMA_TAG_HPP_INCLUDED
22 #define TOOLS_SCHEMA_TAG_HPP_INCLUDED
118 typedef std::map<std::string,class_tag>
tag_map;
121 typedef std::map<std::string,class_key>
key_map;
124 typedef std::map<std::string,std::string>
link_map;
131 typedef std::pair<const_key_iterator,const_key_iterator>
138 typedef std::pair<const_tag_iterator,const_tag_iterator>
145 typedef std::pair<const_link_iterator,const_link_iterator>
187 void print(std::ostream& os);
215 std::istringstream
i(s);
221 std::istringstream
i(s);
331 void printl(std::ostream &os,
int level,
int step = 4);
340 tags_.insert(list.begin(),list.end());
343 keys_.insert(list.begin(),list.end());
346 links_.insert(list.begin(),list.end());
359 #endif // TOOLS_SCHEMA_TAG_HPP_INCLUDED
void remove_keys_by_type(const std::string &type)
Removes all keys with this type.
std::map< std::string, class_tag > tag_map
bool is_mandatory() const
std::string name_
Name of key.
const std::string & get_super() const
bool operator<(const class_tag &t) const
void expand(class_tag &root)
Expands all "super" copying their data to this.
std::pair< std::string, class_key > key_map_value
const class_tag * find_tag(const std::string &fullpath, const class_tag &root) const
Returns pointer to tag using full path to it.
const class_key * find_key(const std::string &name) const
Returns pointer to child key.
std::pair< std::string, class_tag > tag_map_value
void set_max(std::string const &s)
GLuint GLuint GLsizei GLenum type
const std::string * find_link(const std::string &name) const
Returns pointer to child link.
int max_
number of maximum occasions
tag_map::iterator tag_iterator
void remove_key_by_name(const std::string &name)
void set_min(std::string const &s)
void add_key(const class_key &new_key)
bool operator<(const class_key &k) const
Compares keys by name.
const std::string & get_name() const
std::pair< const_link_iterator, const_link_iterator > all_const_link_iterators
key_map::const_iterator const_key_iterator
void append_super(const class_tag &tag, const std::string &super)
Copies tags, keys and links of tag to this.
int min_
number of minimum occasions
const std::string & get_name() const
std::string default_
Default value.
void add_tags(const tag_map &list)
void set_name(const std::string &name)
link_map::iterator link_iterator
void set_name(const std::string &name)
std::string type_
Type of key.
std::pair< const_key_iterator, const_key_iterator > all_const_key_iterators
class_key is used to save the information about one key.
void print(std::ostream &os, int level) const
is used to print key info the format is next [key] name="name" type="type" default="default" mandator...
void expand_all(class_tag &root)
Calls the expansion on each child.
void set_type(const std::string &type)
std::string super_
name of tag to extend "super-tag" Extension is smth like inheritance and is used in case when you nee...
GLsizei const char ** path
all_const_key_iterators keys() const
void add_keys(const key_map &list)
class_key(const std::string &name, const std::string &type, const std::string &def="\"\"")
void set_default(const std::string &def)
std::pair< tag_iterator, tag_iterator > all_tag_iterators
void printl(std::ostream &os, int level, int step=4)
the same as class_tag::print(std::ostream&) but indents different levels with step space...
void set_super(std::string const &s)
bool is_extension() const
void set_mandatory(bool mandatory)
const std::string & get_default() const
void add_links(const link_map &list)
std::pair< link_iterator, link_iterator > all_link_iterators
std::map< std::string, class_key > key_map
void add_link(const std::string &link)
std::pair< key_iterator, key_iterator > all_key_iterators
all_const_link_iterators links() const
all_const_tag_iterators tags() const
link_map links_
links to possible children.
link_map::const_iterator const_link_iterator
tag_map tags_
children tags
class_tag(const std::string &name, int min, int max, const std::string &super="")
std::map< std::string, std::string > link_map
GLuint const GLchar * name
void add_tag(const class_tag &new_tag)
std::string name_
name of tag
std::pair< const_tag_iterator, const_tag_iterator > all_const_tag_iterators
bool mandatory_
Shows, if key is a mandatory key.
A config object defines a single node in a WML file, with access to child nodes.
key_map::iterator key_iterator
std::pair< std::string, std::string > link_map_value
GLsizei const GLcharARB ** string
Stores information about tag.
void print(std::ostream &os)
Prints information about tag to outputstream, recursively is used to print tag info the format is nex...
tag_map::const_iterator const_tag_iterator
bool operator==(const class_tag &other) const
const std::string & get_type() const