sbuild::error< T > Class Template Reference

Error base class. More...

#include <sbuild-error.h>

Inheritance diagram for sbuild::error< T >:

Inheritance graph
[legend]
Collaboration diagram for sbuild::error< T >:

Collaboration graph
[legend]
List of all members.

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.

Detailed Description

template<typename T>
class sbuild::error< T >

Error base class.


Member Typedef Documentation

template<typename T>
typedef T sbuild::error< T >::error_type

Reimplemented in sbuild::custom_error< T >, and sbuild::parse_error< T >.

template<typename T>
typedef std::map<error_type,const char *> sbuild::error< T >::map_type


Constructor & Destructor Documentation

template<typename T>
sbuild::error< T >::error ( std::string const &  error  )  [inline]

The constructor.

Parameters:
error the error message.

template<typename T>
virtual sbuild::error< T >::~error (  )  throw () [inline, virtual]

The destructor.


Member Function Documentation

template<>
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])) 
)

template<>
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])) 
)

template<typename T>
template<typename A, typename B, typename C, typename D, typename E>
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.

Parameters:
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.
Returns:
a translated error message.

template<typename T>
template<typename A, typename B, typename C, typename D, typename E>
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.

Parameters:
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.
Returns:
a translated error message.

template<typename T>
static const char* sbuild::error< T >::get_error ( error_type  error  )  [static, private]

Get a translated error string.

Parameters:
error the error code.
Returns:
a translated error string.


Member Data Documentation

template<typename T>
map_type sbuild::error< T >::error_strings [static, private]

Mapping between error code and string.


The documentation for this class was generated from the following file:
Generated on Fri Jul 14 19:58:24 2006 for schroot by  doxygen 1.4.7