Container of errors, which are generated while schema generator tool is parsing source files. More...
#include <error_container.hpp>
Classes | |
struct | error_cache_element |
Container to cache type errors. More... | |
Public Member Functions | |
class_error_container () | |
void | add_simple_error (const std::string &message) |
Puts simple error message in container. More... | |
void | add_read_error (const std::string &file, int line) |
Generate and put GCC-style error message about error read file error. More... | |
void | add_opened_entity_error (const std::string &file, int line, const std::string &name) |
Generate and put GCC-style error message about annotation block somebody missed to close. More... | |
void | add_unopened_entity_error (const std::string &file, int line, const std::string &name) |
Generate and put GCC-style error message about closing block that wasn't opened. More... | |
void | add_second_parent_error (const std::string &file, int line, const std::string &first, const std::string &second) |
Generate and put GCC-style error message about opening parent block before before closing previous block. More... | |
void | add_orphan_error (const std::string &file, int line, const std::string &name) |
Generate and put GCC-style error message about tag without parent. More... | |
void | wrong_type_error (const std::string &file, int line, const std::string &name, const std::string &value) |
Generate and put GCC-style error message about wrong type value. More... | |
void | add_type_error (const std::string &file, int line, const std::string &type) |
Generate and put GCC-style error message about unknown type to type cache. More... | |
void | remove_type_errors (const std::string &type) |
Clears type cache. More... | |
void | overriding_type_error (const std::string &file, int line, const std::string &type) |
Generate and put GCC-style error message about overriding type Overriding means that that type was defined somewhere else, and it's old value is lost. More... | |
void | add_link_error (const std::string &file, int line, const std::string &link) |
Generate and put GCC-style error message about failed link to link cache. More... | |
void | remove_link_errors (const std::string &link) |
Clears link cache. More... | |
void | print_errors (std::ostream &s) const |
Prints errors to output stream. More... | |
bool | is_empty () const |
Checks, if container is empty. More... | |
Private Types | |
typedef std::map< std::string, std::vector < error_cache_element > > | error_cache_map |
Private Attributes | |
std::vector< std::string > | list_ |
Container to store error messages. More... | |
error_cache_map | types_ |
error_cache_map | links_ |
Container of errors, which are generated while schema generator tool is parsing source files.
These errors are collected here, to be print on screen after parsing.
Definition at line 37 of file error_container.hpp.
|
private |
Definition at line 174 of file error_container.hpp.
|
inline |
Definition at line 39 of file error_container.hpp.
void schema_validation::class_error_container::add_link_error | ( | const std::string & | file, |
int | line, | ||
const std::string & | link | ||
) |
Generate and put GCC-style error message about failed link to link cache.
file | Filename |
line | Number of line with error |
link | Name of link |
Definition at line 89 of file error_container.cpp.
References links_.
Referenced by schema_validation::class_source_parser::check_allow_link(), and schema_validation::class_source_parser::check_tag_begin().
void schema_validation::class_error_container::add_opened_entity_error | ( | const std::string & | file, |
int | line, | ||
const std::string & | name | ||
) |
Generate and put GCC-style error message about annotation block somebody missed to close.
file | Filename |
line | Number of line with error |
name | Name of open block |
Definition at line 34 of file error_container.cpp.
References list_.
Referenced by schema_validation::class_source_parser::add_open_tag_error(), and schema_validation::class_source_parser::parse_keys().
void schema_validation::class_error_container::add_orphan_error | ( | const std::string & | file, |
int | line, | ||
const std::string & | name | ||
) |
Generate and put GCC-style error message about tag without parent.
file | Filename |
line | Number with error |
name | Name of tag |
Definition at line 59 of file error_container.cpp.
References list_.
Referenced by schema_validation::class_source_parser::close_opened_tags().
void schema_validation::class_error_container::add_read_error | ( | const std::string & | file, |
int | line | ||
) |
Generate and put GCC-style error message about error read file error.
file | Filename |
line | Number of line with error |
Definition at line 28 of file error_container.cpp.
References list_.
Referenced by schema_validation::class_source_parser::getline().
void schema_validation::class_error_container::add_second_parent_error | ( | const std::string & | file, |
int | line, | ||
const std::string & | first, | ||
const std::string & | second | ||
) |
Generate and put GCC-style error message about opening parent block before before closing previous block.
file | Filename |
line | Number with error |
first | Name of open parent |
second | Name of parent is opening |
Definition at line 50 of file error_container.cpp.
References list_.
Referenced by schema_validation::class_source_parser::check_parent_begin().
void schema_validation::class_error_container::add_simple_error | ( | const std::string & | message | ) |
Puts simple error message in container.
message | Message to print. |
Definition at line 24 of file error_container.cpp.
References list_.
Referenced by schema_validation::class_source_parser::parse_source(), and schema_validation::class_source_parser::save_schema().
void schema_validation::class_error_container::add_type_error | ( | const std::string & | file, |
int | line, | ||
const std::string & | type | ||
) |
Generate and put GCC-style error message about unknown type to type cache.
file | Filename |
line | Number with error |
type | Name of type |
Definition at line 74 of file error_container.cpp.
References types_.
Referenced by schema_validation::class_source_parser::parse_keys().
void schema_validation::class_error_container::add_unopened_entity_error | ( | const std::string & | file, |
int | line, | ||
const std::string & | name | ||
) |
Generate and put GCC-style error message about closing block that wasn't opened.
file | Filename |
line | Number of line with error |
name | of block |
Definition at line 42 of file error_container.cpp.
References list_.
Referenced by schema_validation::class_source_parser::check_parent_end(), and schema_validation::class_source_parser::check_tag_end().
|
inline |
void schema_validation::class_error_container::overriding_type_error | ( | const std::string & | file, |
int | line, | ||
const std::string & | type | ||
) |
Generate and put GCC-style error message about overriding type Overriding means that that type was defined somewhere else, and it's old value is lost.
file | Filename |
line | Number of line with error |
type | Name of type |
Definition at line 82 of file error_container.cpp.
References list_.
Referenced by schema_validation::class_source_parser::check_allow_type().
void schema_validation::class_error_container::print_errors | ( | std::ostream & | s | ) | const |
void schema_validation::class_error_container::remove_link_errors | ( | const std::string & | link | ) |
Clears link cache.
link | Name of link |
Definition at line 94 of file error_container.cpp.
References links_.
Referenced by schema_validation::class_source_parser::close_opened_tags().
void schema_validation::class_error_container::remove_type_errors | ( | const std::string & | type | ) |
Clears type cache.
type | Name of type |
Definition at line 79 of file error_container.cpp.
References types_.
Referenced by schema_validation::class_source_parser::check_allow_type(), and schema_validation::class_source_parser::check_remove_type().
void schema_validation::class_error_container::wrong_type_error | ( | const std::string & | file, |
int | line, | ||
const std::string & | name, | ||
const std::string & | value | ||
) |
Generate and put GCC-style error message about wrong type value.
file | Filename |
line | Number with error |
name | Name of type |
value | Name of value |
Definition at line 65 of file error_container.cpp.
References list_.
Referenced by schema_validation::class_source_parser::check_allow_type().
|
private |
Definition at line 176 of file error_container.hpp.
Referenced by add_link_error(), is_empty(), print_errors(), and remove_link_errors().
|
private |
Container to store error messages.
Definition at line 156 of file error_container.hpp.
Referenced by add_opened_entity_error(), add_orphan_error(), add_read_error(), add_second_parent_error(), add_simple_error(), add_unopened_entity_error(), is_empty(), overriding_type_error(), print_errors(), and wrong_type_error().
|
private |
Definition at line 175 of file error_container.hpp.
Referenced by add_type_error(), is_empty(), print_errors(), and remove_type_errors().