diff --git a/uppsrc/XmlRpc/XmlRpc.h b/uppsrc/XmlRpc/XmlRpc.h index c397e2468..7da1ff98d 100644 --- a/uppsrc/XmlRpc/XmlRpc.h +++ b/uppsrc/XmlRpc/XmlRpc.h @@ -108,12 +108,20 @@ void ValuePut(Value& v, const Value& t); void ValuePut(Value& v, const ValueArray& va); void ValuePut(Value& v, const ValueMap& vm); +template +Value AsXmlRpcValue(const T& x) +{ + Value vs; + ValuePut(vs, x); + return vs; +} + template void ValuePut(Value& v, const Array& x) { ValueArray va; for(int i = 0; i < x.GetCount(); i++) - va.Add(x[i]); + va.Add(AsXmlRpcValue(x[i])); v = va; } @@ -122,7 +130,7 @@ void ValuePut(Value& v, const Vector& x) { ValueArray va; for(int i = 0; i < x.GetCount(); i++) - va.Add(x[i]); + va.Add(AsXmlRpcValue(x[i])); v = va; } @@ -132,7 +140,7 @@ void ValuePut(Value& v, const ArrayMap& x) ValueMap vm; for(int i = 0; i < x.GetCount(); i++) if(!x.IsUnlinked(i)) - vm.Add(x.GetKey(i), x[i]); + vm.Add(x.GetKey(i), AsXmlRpcValue(x[i])); v = vm; } @@ -142,7 +150,7 @@ void ValuePut(Value& v, const VectorMap& x) ValueMap vm; for(int i = 0; i < x.GetCount(); i++) if(!x.IsUnlinked(i)) - vm.Add(x.GetKey(i), x[i]); + vm.Add(x.GetKey(i), AsXmlRpcValue(x[i])); v = vm; } @@ -152,7 +160,7 @@ void ValuePut(Value& v, const ArrayMap& x) ValueMap vm; for(int i = 0; i < x.GetCount(); i++) if(!x.IsUnlinked(i)) - vm.Add(AsString(x.GetKey(i)), x[i]); + vm.Add(AsString(x.GetKey(i)), AsXmlRpcValue(x[i])); v = vm; } @@ -162,7 +170,7 @@ void ValuePut(Value& v, const VectorMap& x) ValueMap vm; for(int i = 0; i < x.GetCount(); i++) if(!x.IsUnlinked(i)) - vm.Add(AsString(x.GetKey(i)), x[i]); + vm.Add(AsString(x.GetKey(i)), AsXmlRpcValue(x[i])); v = vm; }