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 » Community » Newbie corner » Storing VectorMap
Storing VectorMap [message #36283] Fri, 18 May 2012 09:12 Go to next message
idkfa46 is currently offline  idkfa46
Messages: 155
Registered: December 2011
Experienced Member
Hallo guys,

I'm here again with a new little drawback xmlizing my VectorMap<Value, Value> v.

Xmlize pseudocode:
void prova6::Xmlize(XmlIO& xml)
{
	if(xml.IsLoading())
  	{...}
 	if(xml.IsStoring())
 	{
 		v.Add(elemento);
 		
 		XmlizeStore(xml, v);
		xml.Add("valori")
			("elem", val);


I'm trying to obtain something like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE Materiali>
<Materiali>
	<key>gcvh</key>
	<valori>
		<elem value="5"/>
	</valori>
</Materiali>


but, at the moment the result is:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE Materiali>
<Materiali>
        <key type="String">gcvh</key>
	<value type="void"/>
	<valori>
		<elem value="5"/>
	</valori>
</Materiali>


Is there a way to eliminate type="String" and <value type="void"/> ?

Regards,
Matteo
Re: Storing VectorMap [message #36287 is a reply to message #36283] Fri, 18 May 2012 11:24 Go to previous message
idkfa46 is currently offline  idkfa46
Messages: 155
Registered: December 2011
Experienced Member
Solved (thank you Max) using

VectorMap<int, String> v;

and
...
if(xml.IsStoring())
 	{
 		v.Add(dl.GetCount(), elemento);
 		
 		XmlizeStore(xml, v.GetValues());
		xml.Add ("valori")
			("elem",	val)
		;
...


Regards,
Matteo
Previous Topic: How do I 'check' a Switch control
Next Topic: Strange problem using URR...
Goto Forum:
  


Current Time: Fri Mar 29 14:23:04 CET 2024

Total time taken to generate the page: 0.01288 seconds