wml_key is used to save the information about one key. More...
#include <key.hpp>
Public Member Functions | |
wml_key () | |
wml_key (const std::string &name, const std::string &type, const std::string &def="\"\"") | |
wml_key (const config &) | |
const std::string & | get_name () const |
const std::string & | get_type () const |
const std::string & | get_default () const |
bool | is_mandatory () const |
bool | is_fuzzy () const |
void | set_name (const std::string &name) |
void | set_type (const std::string &type) |
void | set_default (const std::string &def) |
void | set_mandatory (bool mandatory) |
void | set_fuzzy (bool f) |
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" mandatory="true/false" [/key] More... | |
bool | operator< (const wml_key &k) const |
Compares keys by name. More... | |
Private Attributes | |
std::string | name_ |
Name of key. More... | |
std::string | type_ |
Type of key. More... | |
std::string | default_ |
Default value. More... | |
bool | mandatory_ |
Shows, if key is a mandatory key. More... | |
bool | fuzzy_ |
Whether the key is a fuzzy match. More... | |
wml_key is used to save the information about one key.
Key has next info: name, type, default value or key is mandatory.
|
inline |
schema_validation::wml_key::wml_key | ( | const config & | cfg | ) |
Definition at line 28 of file key.cpp.
References default_, config::has_attribute(), and mandatory_.
|
inline |
|
inline |
Definition at line 59 of file key.hpp.
References name_.
Referenced by schema_validation::wml_tag::add_key(), and operator<().
|
inline |
Definition at line 64 of file key.hpp.
References type_.
Referenced by schema_validation::schema_validator::validate_key().
|
inline |
|
inline |
|
inline |
Compares keys by name.
Used in std::sort, i.e.
Definition at line 123 of file key.hpp.
References get_name().
void schema_validation::wml_key::print | ( | std::ostream & | os, |
int | level | ||
) | const |
is used to print key info the format is next [key] name="name" type="type" default="default" mandatory="true/false" [/key]
Definition at line 44 of file key.cpp.
References default_, is_mandatory(), game_config::images::level, name_, s, and type_.
|
inline |
Definition at line 93 of file key.hpp.
References default_, and mandatory_.
|
inline |
|
inline |
Definition at line 101 of file key.hpp.
References mandatory_.
|
inline |
|
inline |
|
private |
Default value.
Definition at line 136 of file key.hpp.
Referenced by get_default(), print(), set_default(), and wml_key().
|
private |
Whether the key is a fuzzy match.
Definition at line 142 of file key.hpp.
Referenced by is_fuzzy(), and set_fuzzy().
|
private |
Shows, if key is a mandatory key.
Definition at line 139 of file key.hpp.
Referenced by is_mandatory(), set_default(), set_mandatory(), and wml_key().
|
private |
Name of key.
Definition at line 130 of file key.hpp.
Referenced by get_name(), print(), and set_name().
|
private |
Type of key.
Definition at line 133 of file key.hpp.
Referenced by get_type(), print(), and set_type().