Used in parsing config file. More...
#include <validator.hpp>
Classes | |
struct | error |
Used to manage with not initialized validators Supposed to be thrown from the constructor. More... | |
Public Member Functions | |
abstract_validator (const std::string &name) | |
Constructor of validator can throw validator::error. More... | |
virtual | ~abstract_validator () |
virtual void | open_tag (const std::string &name, const config &parent, int start_line, const std::string &file, bool addition=false)=0 |
Is called when parser opens tag. More... | |
virtual void | close_tag ()=0 |
As far as parser is built on stack, some realizations can store stack too. More... | |
virtual void | validate (const config &cfg, const std::string &name, int start_line, const std::string &file)=0 |
Validates config. More... | |
virtual void | validate_key (const config &cfg, const std::string &name, const config_attribute_value &value, int start_line, const std::string &file)=0 |
Checks if key is allowed and if its value is valid What exactly is validated depends on validator realization. More... | |
Public Attributes | |
const std::string | name_ |
Used in parsing config file.
parser.cpp Contains virtual methods, which are called by parser and take information about config to be validated
Definition at line 37 of file validator.hpp.
|
inline |
Constructor of validator can throw validator::error.
abstract_validator::error |
Definition at line 44 of file validator.hpp.
|
inlinevirtual |
Definition at line 46 of file validator.hpp.
|
pure virtual |
As far as parser is built on stack, some realizations can store stack too.
So they need to know if tag was closed.
Implemented in schema_validation::schema_self_validator, and schema_validation::schema_validator.
|
pure virtual |
Is called when parser opens tag.
name | Name of tag |
parent | The parent config |
start_line | Line in file |
file | Name of file |
addition |
Implemented in schema_validation::schema_self_validator, and schema_validation::schema_validator.
|
pure virtual |
Validates config.
Checks if all mandatory elements are present. What exactly is validated depends on validator realization
cfg | Config to be validated. |
name | Name of tag |
start_line | Line in file |
file | Name of file |
Implemented in schema_validation::schema_self_validator, and schema_validation::schema_validator.
|
pure virtual |
Checks if key is allowed and if its value is valid What exactly is validated depends on validator realization.
cfg | Config to be validated. |
name | Name of tag |
value | The key's value |
start_line | Line in file |
file | Name of file |
Implemented in schema_validation::schema_self_validator, and schema_validation::schema_validator.
const std::string abstract_validator::name_ |
Definition at line 101 of file validator.hpp.
Referenced by schema_validation::schema_validator::detect_derivation_cycles(), and schema_validation::schema_validator::validate().