freeswitch/libs/xmlrpc-c/src/cpp/fault.cpp

36 lines
729 B
C++

#include <string>
#include "xmlrpc-c/girerr.hpp"
using girerr::error;
#include "xmlrpc-c/base.hpp"
using namespace std;
namespace xmlrpc_c {
fault::fault() : valid(false) {};
fault::fault(string const _description,
xmlrpc_c::fault::code_t const _code
) :
valid(true),
code(_code),
description(_description)
{}
xmlrpc_c::fault::code_t
fault::getCode() const {
if (!valid)
throw(error("Attempt to access placeholder xmlrpc_c::fault object"));
return this->code;
}
string
fault::getDescription() const {
if (!valid)
throw(error("Attempt to access placeholder xmlrpc_c::fault object"));
return this->description;
}
} // namespace