2006-12-21 03:57:49 +00:00
|
|
|
#ifndef GIRERR_HPP_INCLUDED
|
|
|
|
#define GIRERR_HPP_INCLUDED
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <exception>
|
|
|
|
|
2012-10-13 11:37:25 -05:00
|
|
|
#include <xmlrpc-c/c_util.h>
|
|
|
|
|
2006-12-21 03:57:49 +00:00
|
|
|
#define HAVE_GIRERR_ERROR
|
|
|
|
|
|
|
|
namespace girerr {
|
|
|
|
|
2012-10-13 11:37:25 -05:00
|
|
|
class XMLRPC_DLLEXPORT error : public std::exception {
|
2006-12-21 03:57:49 +00:00
|
|
|
public:
|
|
|
|
error(std::string const& what_arg) : _what(what_arg) {}
|
|
|
|
|
|
|
|
~error() throw() {}
|
|
|
|
|
|
|
|
virtual const char *
|
|
|
|
what() const throw() { return this->_what.c_str(); };
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::string _what;
|
|
|
|
};
|
|
|
|
|
2008-05-23 20:56:24 +00:00
|
|
|
// throwf() always throws a girerr::error .
|
|
|
|
|
2012-10-13 11:37:25 -05:00
|
|
|
XMLRPC_DLLEXPORT
|
2008-05-23 20:56:24 +00:00
|
|
|
void
|
2012-10-13 11:37:25 -05:00
|
|
|
throwf(const char * const format, ...)
|
|
|
|
XMLRPC_PRINTF_ATTR(1,2)
|
|
|
|
XMLRPC_NORETURN_ATTR;
|
2008-05-23 20:56:24 +00:00
|
|
|
|
2006-12-21 03:57:49 +00:00
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif
|