Implementation for wml_exception.hpp. More...
#include "global.hpp"#include "wml_exception.hpp"#include "display.hpp"#include "gettext.hpp"#include "gui/dialogs/message.hpp"#include "formula_string_utils.hpp"#include "log.hpp"
Go to the source code of this file.
Defines | |
| #define | GETTEXT_DOMAIN "wesnoth-lib" |
| #define | WRN_NG LOG_STREAM(warn, log_engine) |
Functions | |
| void | wml_exception (const char *cond, const char *file, const int line, const char *function, const std::string &message, const std::string &dev_message) |
| Helper function, don't call this directly. | |
| std::string | missing_mandatory_wml_key (const std::string §ion, const std::string &key, const std::string &primary_key, const std::string &primary_value) |
| Returns a standard message for a missing wml key. | |
| std::string | deprecate_wml_key_warning (const std::string &key, const std::string &removal_version) |
| Returns a standard warning message for using a deprecated wml key. | |
| std::string | deprecated_renamed_wml_key_warning (const std::string &deprecated_key, const std::string &key, const std::string &removal_version) |
| Returns a standard warning message for using a deprecated renamed wml key. | |
| const config::attribute_value & | get_renamed_config_attribute (const config &cfg, const std::string &deprecated_key, const std::string &key, const std::string &removal_version) |
| Returns a config attribute, using either the old name or the new one. | |
Variables | |
| static lg::log_domain | log_engine ("engine") |
Implementation for wml_exception.hpp.
Definition in file wml_exception.cpp.
| #define GETTEXT_DOMAIN "wesnoth-lib" |
Definition at line 21 of file wml_exception.cpp.
| #define WRN_NG LOG_STREAM(warn, log_engine) |
Definition at line 33 of file wml_exception.cpp.
Referenced by missing_mandatory_wml_key().
| std::string deprecate_wml_key_warning | ( | const std::string & | key, | |
| const std::string & | removal_version | |||
| ) |
Returns a standard warning message for using a deprecated wml key.
| key | The deprecated key. | |
| removal_version | The version in which the key will be removed key. |
Definition at line 105 of file wml_exception.cpp.
References vgettext().

| std::string deprecated_renamed_wml_key_warning | ( | const std::string & | deprecated_key, | |
| const std::string & | key, | |||
| const std::string & | removal_version | |||
| ) |
Returns a standard warning message for using a deprecated renamed wml key.
| deprecated_key | The deprecated key. | |
| key | The new key to be used. | |
| removal_version | The version in which the key will be removed key. |
Definition at line 120 of file wml_exception.cpp.
References vgettext().
Referenced by get_renamed_config_attribute().


| const config::attribute_value& get_renamed_config_attribute | ( | const config & | cfg, | |
| const std::string & | deprecated_key, | |||
| const std::string & | key, | |||
| const std::string & | removal_version | |||
| ) |
Returns a config attribute, using either the old name or the new one.
The function first tries the find the attribute using key and if that doesn't find the attribute it tries deprecated_key. If that test finds an attribute it will issue a warning and return the result. Else returns an empty attribute.
| cfg | The config to get the attribute from. | |
| deprecated_key | The deprecated key. | |
| key | The new key to be used. | |
| removal_version | The version in which the key will be removed key. |
Definition at line 141 of file wml_exception.cpp.
References deprecated_renamed_wml_key_warning(), config::get(), and lg::wml_error.

| std::string missing_mandatory_wml_key | ( | const std::string & | section, | |
| const std::string & | key, | |||
| const std::string & | primary_key = "", |
|||
| const std::string & | primary_value = "" | |||
| ) |
Returns a standard message for a missing wml key.
| section | The section is which the key should appear (this should include the section brackets). It may contain parent sections to make it easier to find the wanted sections. They are listed like [parent][child][section]. | |
| key | The ommitted key. | |
| primary_key | The primary key of the section. | |
| primary_value | The value of the primary key (mandatory if primary key isn't empty). |
Definition at line 73 of file wml_exception.cpp.
References vgettext(), and WRN_NG.
Referenced by gui2::twindow_builder::read(), gui2::tcontrol_definition::tcontrol_definition(), terrain_type::terrain_type(), tportrait::tportrait(), gui2::twindow_builder::tresolution::tresolution(), and gui2::twindow_builder::tresolution::ttip::ttip().


| void wml_exception | ( | const char * | cond, | |
| const char * | file, | |||
| int | line, | |||
| const char * | function, | |||
| const std::string & | message, | |||
| const std::string & | dev_message = "" | |||
| ) |
Helper function, don't call this directly.
| cond | The textual presentation of the test that failed. | |
| file | The file in which the test failed. | |
| line | The line at which the test failed. | |
| function | The function in which the test failed. | |
| message | The translated message to show the user. |
Definition at line 35 of file wml_exception.cpp.
lg::log_domain log_engine("engine") [static] |
| Generated by doxygen 1.7.1 on Fri May 25 2012 01:11:15 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |