The Battle for Wesnoth  1.17.21+dev
Macros | Functions | Variables
wml_exception.cpp File Reference

Implementation for wml_exception.hpp. More...

#include "wml_exception.hpp"
#include "gettext.hpp"
#include "gui/dialogs/message.hpp"
#include "formula/string_utils.hpp"
#include "log.hpp"
Include dependency graph for wml_exception.cpp:

Go to the source code of this file.


#define GETTEXT_DOMAIN   "wesnoth-lib"
#define WRN_NG   LOG_STREAM(warn, log_engine)
#define ERR_WML   LOG_STREAM(err, log_wml)


void throw_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. More...
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. More...


static lg::log_domain log_engine ("engine")
static lg::log_domain log_wml ("wml")

Detailed Description

Implementation for wml_exception.hpp.

Definition in file wml_exception.cpp.

Macro Definition Documentation


#define ERR_WML   LOG_STREAM(err, log_wml)

Definition at line 34 of 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 31 of file wml_exception.cpp.

Function Documentation

◆ missing_mandatory_wml_key()

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.

sectionThe 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].
keyThe omitted key.
primary_keyThe primary key of the section.
primary_valueThe value of the primary key (mandatory if primary key isn't empty).
The error message.

Definition at line 74 of file wml_exception.cpp.

References VGETTEXT, and WRN_NG.

Referenced by expand_partialresolution(), gui2::gui_definition::gui_definition(), gui2::parse_linked_group_definitions(), gui2::implementation::parse_list_data(), gui2::builder_window::read(), gui2::horizontal_scrollbar_definition::resolution::resolution(), gui2::slider_definition::resolution::resolution(), gui2::vertical_scrollbar_definition::resolution::resolution(), gui2::styled_widget_definition::styled_widget_definition(), terrain_type::terrain_type(), gui2::builder_window::window_resolution::tooltip_info::tooltip_info(), gui2::implementation::tree_node::tree_node(), and gui2::builder_window::window_resolution::window_resolution().

◆ throw_wml_exception()

void throw_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.

condThe textual presentation of the test that failed.
fileThe file in which the test failed.
lineThe line at which the test failed.
functionThe function in which the test failed.
messageThe translated message to show the user.
dev_messageAny additional information that might be useful to a developer.

Definition at line 36 of file wml_exception.cpp.

References draw::line().

Variable Documentation

◆ log_engine

lg::log_domain log_engine("engine") ( "engine"  )

◆ log_wml

lg::log_domain log_wml("wml") ( "wml"  )