mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-18 02:01:53 +00:00
add xmlrpc-c 1.03.14 to in tree libs
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3772 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
#include "xmlrpc-c/girerr.hpp"
|
||||
using girerr::error;
|
||||
#include "xmlrpc-c/base.hpp"
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace xmlrpc_c {
|
||||
|
||||
rpcOutcome::rpcOutcome() : valid(false) {}
|
||||
|
||||
rpcOutcome::rpcOutcome(xmlrpc_c::value const result) :
|
||||
valid(true), _succeeded(true), result(result)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
rpcOutcome::rpcOutcome(xmlrpc_c::fault const fault) :
|
||||
valid(true), _succeeded(false), fault(fault)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
bool
|
||||
rpcOutcome::succeeded() const {
|
||||
if (!valid)
|
||||
throw(error("Attempt to access rpcOutcome object before setting it"));
|
||||
return _succeeded;
|
||||
}
|
||||
|
||||
|
||||
|
||||
fault
|
||||
rpcOutcome::getFault() const {
|
||||
|
||||
if (!valid)
|
||||
throw(error("Attempt to access rpcOutcome object before setting it"));
|
||||
if (_succeeded)
|
||||
throw(error("Attempt to get fault description from a non-failure "
|
||||
"RPC outcome"));
|
||||
return fault;
|
||||
}
|
||||
|
||||
|
||||
|
||||
value
|
||||
rpcOutcome::getResult() const {
|
||||
|
||||
if (!valid)
|
||||
throw(error("Attempt to access rpcOutcome object before setting it"));
|
||||
if (!_succeeded)
|
||||
throw(error("Attempt to get result from an unsuccessful RPC outcome"));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user