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++ Core » Custom array Jsonize
Re: Custom array Jsonize [message #36229 is a reply to message #36226] Tue, 15 May 2012 00:46 Go to previous message
koldo is currently offline  koldo
Messages: 3361
Registered: August 2008
Senior Veteran
Well, this works well but is less efficient Smile :

void Jsonize(JsonIO &xml, MyVector &vec) {
	Vector<double> vector;
	if(xml.IsStoring()) {
		vector.SetCount(vec.size());
		for (int i = 0; i < vec.size(); ++i)
			vector[i] = vec(i);
		xml("vector", vector);
	} else {
		xml("vector", vector);
		vec.resize(vector.GetCount());
		for (int i = 0; i < vec.size(); ++i)
			vec(i) = vector[i];
	}
}


Best regards
IƱaki
 
Read Message
Read Message
Previous Topic: Jsonize problem with Null
Next Topic: File locking and Serialization
Goto Forum:
  


Current Time: Fri May 10 01:13:38 CEST 2024

Total time taken to generate the page: 0.04184 seconds