Classes | Public Member Functions | Private Types | Private Attributes

schema_validation::class_error_container Class Reference

Container of errors, which are generated while schema generator tool is parsing source files. More...

#include <error_container.hpp>

Collaboration diagram for schema_validation::class_error_container:
Collaboration graph
[legend]

List of all members.

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.
void add_read_error (const std::string &file, int line)
 Generate and put GCC-style error message about error read file error.
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.
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.
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.
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.
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.
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.
void remove_type_errors (const std::string &type)
 Clears type cache.
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.
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.
void remove_link_errors (const std::string &link)
 Clears link cache.
void print_errors (std::ostream &s) const
 Prints errors to output stream.
bool is_empty () const
 Checks, if container is empty.

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.
error_cache_map types_
error_cache_map links_

Detailed Description

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 38 of file error_container.hpp.


Member Typedef Documentation

typedef std::map<std::string, std::vector<error_cache_element> > schema_validation::class_error_container::error_cache_map [private]

Definition at line 175 of file error_container.hpp.


Constructor & Destructor Documentation

schema_validation::class_error_container::class_error_container (  )  [inline]

Definition at line 40 of file error_container.hpp.


Member Function Documentation

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.

Parameters:
file Filename
line Number of line with error
name Name of link

Definition at line 89 of file error_container.cpp.

Referenced by schema_validation::class_source_parser::check_allow_link(), and schema_validation::class_source_parser::check_tag_begin().

Here is the caller graph for this function:

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.

Parameters:
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().

Here is the caller graph for this function:

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.

Parameters:
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().

Here is the caller graph for this function:

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.

Parameters:
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().

Here is the caller graph for this function:

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.

Parameters:
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().

Here is the caller graph for this function:

void schema_validation::class_error_container::add_simple_error ( const std::string &  message  ) 

Puts simple error message in container.

Parameters:
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().

Here is the caller graph for this function:

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.

Parameters:
file Filename
line Number with error
name Name of type

Definition at line 74 of file error_container.cpp.

References types_.

Referenced by schema_validation::class_source_parser::parse_keys().

Here is the caller graph for this function:

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.

Parameters:
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().

Here is the caller graph for this function:

bool schema_validation::class_error_container::is_empty (  )  const [inline]

Checks, if container is empty.

Definition at line 152 of file error_container.hpp.

References links_, list_, and types_.

Referenced by main().

Here is the caller graph for this function:

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.

Parameters:
file Filename
line Number of line with error
name Name of type

Definition at line 82 of file error_container.cpp.

Referenced by schema_validation::class_source_parser::check_allow_type().

Here is the caller graph for this function:

void schema_validation::class_error_container::print_errors ( std::ostream &  s  )  const

Prints errors to output stream.

Parameters:
s Output

Definition at line 99 of file error_container.cpp.

References links_, list_, and types_.

Referenced by main().

Here is the caller graph for this function:

void schema_validation::class_error_container::remove_link_errors ( const std::string &  link  ) 

Clears link cache.

Parameters:
name Name of link

Definition at line 94 of file error_container.cpp.

References links_.

Referenced by schema_validation::class_source_parser::close_opened_tags().

Here is the caller graph for this function:

void schema_validation::class_error_container::remove_type_errors ( const std::string &  type  ) 

Clears type cache.

Parameters:
name 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().

Here is the caller graph for this function:

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.

Parameters:
file Filename
line Number with error
name Name of type
value Name of value

Definition at line 65 of file error_container.cpp.

Referenced by schema_validation::class_source_parser::check_allow_type().

Here is the caller graph for this function:


Member Data Documentation

Definition at line 177 of file error_container.hpp.

Referenced by is_empty(), print_errors(), and remove_link_errors().

std::vector<std::string> schema_validation::class_error_container::list_ [private]

Definition at line 176 of file error_container.hpp.

Referenced by add_type_error(), is_empty(), print_errors(), and remove_type_errors().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:25:44 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs