Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » XmlRpc Bugfixes
XmlRpc Bugfixes [message #31980] Wed, 13 April 2011 23:14 Go to next message
zsolt is currently offline  zsolt
Messages: 693
Registered: December 2005
Location: Budapest, Hungary
Contributor
I was not able to send array or vector of structs because of some missing functionalities.

These are the fixed functions in XmlRpc.h from line 111:

template <class T>
void ValuePut(Value& v, const Array<T>& x)
{
	ValueArray va;
	for(int i=0; i<x.GetCount(); i++){
		Value vs;
		ValuePut(vs, x[i]);
		va.Add(vs);
	}
	v = va;
}

template <class T>
void ValuePut(Value& v, const Vector<T>& x)
{
	ValueArray va;
	for(int i=0; i<x.GetCount(); i++){
		Value vs;
		ValuePut(vs, x[i]);
		va.Add(vs);
	}
	v = va;
}


I attached a demo demonstrating the fixes.

There is a server sending a struct with an array and a vector of struct and a client showing the received data.

These would be useful as reference examples, I think.
Re: XmlRpc Bugfixes [message #31984 is a reply to message #31980] Thu, 14 April 2011 09:57 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
zsolt wrote on Wed, 13 April 2011 17:14

I was not able to send array or vector of structs because of some missing functionalities.

These are the fixed functions in XmlRpc.h from line 111:

template <class T>
void ValuePut(Value& v, const Array<T>& x)
{
	ValueArray va;
	for(int i=0; i<x.GetCount(); i++){
		Value vs;
		ValuePut(vs, x[i]);
		va.Add(vs);
	}
	v = va;
}

template <class T>
void ValuePut(Value& v, const Vector<T>& x)
{
	ValueArray va;
	for(int i=0; i<x.GetCount(); i++){
		Value vs;
		ValuePut(vs, x[i]);
		va.Add(vs);
	}
	v = va;
}


I attached a demo demonstrating the fixes.

There is a server sending a struct with an array and a vector of struct and a client showing the received data.

These would be useful as reference examples, I think.


Fixed using a little bit different code, I have added support to ArrayMap and VectorMap as well...
Re: XmlRpc Bugfixes [message #31986 is a reply to message #31984] Thu, 14 April 2011 10:25 Go to previous message
zsolt is currently offline  zsolt
Messages: 693
Registered: December 2005
Location: Budapest, Hungary
Contributor
Thanks.
Previous Topic: Web or HttpClient example?
Next Topic: FIXES/ADDS: CtrlLib: properties getters
Goto Forum:
  


Current Time: Thu Mar 28 18:27:48 CET 2024

Total time taken to generate the page: 0.01510 seconds