wml_exception.hpp File Reference

Add a special kind of assert to validate whether the input from WML doesn't contain any problems that might crash the game. More...

#include "tstring.hpp"
#include <string>

Include dependency graph for wml_exception.hpp:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  twml_exception
 Helper class, don't construct this directly. More...

Defines

#define VALIDATE(cond, message)   if(!(cond)) wml_exception(#cond, __FILE__, __LINE__, __FUNCTION__, message)
 The macro to use for the validation of WML.

Functions

void wml_exception (const char *cond, const char *file, const int line, const char *function, const t_string &message)
 Helper function, don't call this directly.
void wml_exception (const char *cond, const char *file, const int line, const char *function, const char *message)
 Helper function, don't call this directly.
void wml_exception (const char *cond, const char *file, const int line, const char *function, const std::string &message)
 Helper function, don't call this directly.
t_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.


Detailed Description

Add a special kind of assert to validate whether the input from WML doesn't contain any problems that might crash the game.

Definition in file wml_exception.hpp.


Define Documentation

#define VALIDATE ( cond,
message   )     if(!(cond)) wml_exception(#cond, __FILE__, __LINE__, __FUNCTION__, message)


Function Documentation

t_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.

Parameters:
section The section is which the key should appear.
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).
Returns:
The error message.

Definition at line 60 of file wml_exception.cpp.

References vgettext().

Referenced by gui2::twindow_builder::read(), gui2::tgui_definition::read(), gui2::tcontrol_definition::tcontrol_definition(), terrain_type::terrain_type(), gui2::twindow_builder::tresolution::tresolution(), and gui2::tvertical_scrollbar_definition::tresolution::tresolution().

void wml_exception ( const char *  cond,
const char *  file,
const int  line,
const char *  function,
const std::string &  message 
) [inline]

Helper function, don't call this directly.

Definition at line 69 of file wml_exception.hpp.

References wml_exception().

void wml_exception ( const char *  cond,
const char *  file,
const int  line,
const char *  function,
const char *  message 
) [inline]

Helper function, don't call this directly.

Definition at line 62 of file wml_exception.hpp.

References wml_exception().

void wml_exception ( const char *  cond,
const char *  file,
const int  line,
const char *  function,
const t_string message 
)

Helper function, don't call this directly.

Parameters:
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 funtion in which the test failed.
message The translatable message to show the user.

Definition at line 30 of file wml_exception.cpp.

References t_string::str().

Referenced by wml_exception().


Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs