mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-09 03:24:59 -06:00
XmlRpc: Extended to deal with Array/Vector/ArrayMap/VectorMap of xmlrpc compatible structures (thanks zsolt)
git-svn-id: svn://ultimatepp.org/upp/trunk@3341 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
bbc2ef5b80
commit
35dbcfbd92
1 changed files with 14 additions and 6 deletions
|
|
@ -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 <class T>
|
||||
Value AsXmlRpcValue(const T& x)
|
||||
{
|
||||
Value vs;
|
||||
ValuePut(vs, x);
|
||||
return vs;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void ValuePut(Value& v, const Array<T>& 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<T>& 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<String, T>& 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<String, T>& 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<int, T>& 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<int, T>& 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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue