From 02f03174faadfa9c1e43590b940721efaaa027c0 Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Thu, 13 Nov 2008 23:24:04 +0000 Subject: [PATCH] made struct access optional (compile time define), as it depends on newer xmlrpcpp version git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1131 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- apps/xmlrpc2di/Makefile | 6 +++++- apps/xmlrpc2di/XMLRPC2DI.cpp | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/xmlrpc2di/Makefile b/apps/xmlrpc2di/Makefile index 6e7af916..7e595502 100644 --- a/apps/xmlrpc2di/Makefile +++ b/apps/xmlrpc2di/Makefile @@ -3,10 +3,14 @@ XMLRPCPP_DIR = xmlrpc++0.7 plug_in_name = xmlrpc2di module_ldflags = -lxmlrpc++ -module_cflags = -DHAVE_XMLRPCPP_SSL +module_cflags = # for gentoo ebuild or cvs-20040713 version: # module_cflags = -DHAVE_XMLRPCPP_SSL # +# if your xmlrpcpp version has access to struct value map +#( operator XmlRpcValue::ValueStruct const&() in XmlRpcValue.h around line 168) +# you can support struct type in XMLRPC conversion +# -D XMLRPCPP_SUPPORT_STRUCT_ACCESS # use these for local installation: # module_cflags = -I$(XMLRPCPP_DIR)/src diff --git a/apps/xmlrpc2di/XMLRPC2DI.cpp b/apps/xmlrpc2di/XMLRPC2DI.cpp index 1e4675a3..07a3e23f 100644 --- a/apps/xmlrpc2di/XMLRPC2DI.cpp +++ b/apps/xmlrpc2di/XMLRPC2DI.cpp @@ -474,14 +474,17 @@ void XMLRPC2DIServer::xmlrpcval2amarg(XmlRpcValue& v, AmArg& a, a[a.size()-1].assertArray(0); AmArg arr; xmlrpcval2amarg(v[i], a[a.size()-1], 0); - } break; + } break; +#ifdef XMLRPCPP_SUPPORT_STRUCT_ACCESS case XmlRpcValue::TypeStruct: { for (XmlRpc::XmlRpcValue::ValueStruct::iterator it= - ((XmlRpcValue::ValueStruct)v).begin(); it != ((XmlRpcValue::ValueStruct)v).end(); it++) { + ((XmlRpcValue::ValueStruct)v).begin(); + it != ((XmlRpcValue::ValueStruct)v).end(); it++) { a[it->first] = AmArg(); xmlrpcval2amarg(it->second, a[it->first], 0); } } break; +#endif // TODO: support more types (datetime, struct, ...) default: throw XmlRpcException("unsupported parameter type", 400);