class_key is used to save the information about one key. More...
#include <tag.hpp>
Public Member Functions | |
class_key () | |
class_key (const std::string &name, const std::string &type, const std::string &def="\"\"") | |
class_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 |
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 | 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 class_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... | |
class_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::class_key::class_key | ( | const config & | cfg | ) |
Definition at line 39 of file tag.cpp.
References default_, config::has_attribute(), and mandatory_.
|
inline |
|
inline |
Definition at line 52 of file tag.hpp.
References name_.
Referenced by schema_validation::class_tag::add_key(), and operator<().
|
inline |
Definition at line 55 of file tag.hpp.
References type_.
Referenced by schema_validation::schema_validator::validate_key().
|
inline |
|
inline |
Compares keys by name.
Used in std::sort, i.e.
Definition at line 94 of file tag.hpp.
References get_name().
|
inline |
Definition at line 71 of file tag.hpp.
References default_, and mandatory_.
|
inline |
Definition at line 77 of file tag.hpp.
References mandatory_.
|
inline |
|
inline |
|
private |
Default value.
Definition at line 103 of file tag.hpp.
Referenced by class_key(), get_default(), print(), and set_default().
|
private |
Shows, if key is a mandatory key.
Definition at line 105 of file tag.hpp.
Referenced by class_key(), is_mandatory(), set_default(), and set_mandatory().
|
private |
Name of key.
Definition at line 99 of file tag.hpp.
Referenced by get_name(), print(), and set_name().
|
private |
Type of key.
Definition at line 101 of file tag.hpp.
Referenced by get_type(), print(), and set_type().