#include <sbuild-error.h>
Inheritance diagram for sbuild::error< T >:
Public Types | |
typedef T | error_type |
typedef std::map< error_type, const char * > | map_type |
Public Member Functions | |
error (std::string const &error) | |
The constructor. | |
virtual | ~error () throw () |
The destructor. | |
template<> | |
sbuild::error< main_base::error_code >::map_type | error_strings (init_errors, init_errors+(sizeof(init_errors)/sizeof(init_errors[0]))) |
template<> | |
sbuild::error< main::error_code >::map_type | error_strings (init_errors, init_errors+(sizeof(init_errors)/sizeof(init_errors[0]))) |
Static Protected Member Functions | |
template<typename A, typename B, typename C, typename D, typename E> | |
static std::string | format_error (A const &context1, B const &context2, C const &context3, error_type error, D const &detail1, E const &detail2) |
Format an error message. | |
template<typename A, typename B, typename C, typename D, typename E> | |
static std::string | format_error (A const &context1, B const &context2, C const &context3, std::runtime_error const &error, D const &detail1, E const &detail2) |
Format an error message. | |
Static Private Member Functions | |
static const char * | get_error (error_type error) |
Get a translated error string. | |
Static Private Attributes | |
static map_type | error_strings |
Mapping between error code and string. |
typedef T sbuild::error< T >::error_type |
Reimplemented in sbuild::custom_error< T >, and sbuild::parse_error< T >.
typedef std::map<error_type,const char *> sbuild::error< T >::map_type |
sbuild::error< T >::error | ( | std::string const & | error | ) | [inline] |
The constructor.
error | the error message. |
virtual sbuild::error< T >::~error | ( | ) | throw () [inline, virtual] |
The destructor.
sbuild::error< main::error_code >::map_type sbuild::error< main::error_code >::error_strings | ( | init_errors | , | |
init_errors+ | (sizeof(init_errors)/sizeof(init_errors[0])) | |||
) |
sbuild::error< main_base::error_code >::map_type sbuild::error< main_base::error_code >::error_strings | ( | init_errors | , | |
init_errors+ | (sizeof(init_errors)/sizeof(init_errors[0])) | |||
) |
static std::string sbuild::error< T >::format_error | ( | A const & | context1, | |
B const & | context2, | |||
C const & | context3, | |||
std::runtime_error< T > const & | error, | |||
D const & | detail1, | |||
E const & | detail2 | |||
) | [static, protected] |
Format an error message.
context1 | context of the error. | |
context2 | additional context of the error. | |
context3 | additional context of the error. | |
error | the error code. | |
detail1 | details of the error. | |
detail2 | additional details of the error. |
static std::string sbuild::error< T >::format_error | ( | A const & | context1, | |
B const & | context2, | |||
C const & | context3, | |||
error_type | error, | |||
D const & | detail1, | |||
E const & | detail2 | |||
) | [static, protected] |
Format an error message.
context1 | context of the error. | |
context2 | additional context of the error. | |
context3 | additional context of the error. | |
error | the error code. | |
detail1 | details of the error. | |
detail2 | additional details of the error. |
static const char* sbuild::error< T >::get_error | ( | error_type | error | ) | [static, private] |
Get a translated error string.
error | the error code. |
map_type sbuild::error< T >::error_strings [static, private] |
Mapping between error code and string.