Home » Developing U++ » U++ Developers corner » Xmlize values
Xmlize values [message #25441] |
Wed, 24 February 2010 00:12 |
mdelfede
Messages: 1307 Registered: September 2007
|
Ultimate Contributor |
|
|
Here the sample code for few types :
template<> void Xmlize(XmlIO xml, Value& var)
{
dword type;
if(xml.IsLoading())
{
xml.Attr("type", type);
switch(type)
{
case INT_V:
{
int i;
xml.Attr("value", i);
var = i;
break;
}
case DOUBLE_V:
{
double d;
xml.Attr("value", d);
var = d;
break;
}
case STRING_V:
{
String s;
xml.Attr("value", s);
var = s;
break;
}
case BOOL_V:
{
bool b;
xml.Attr("value", b);
var = b;
break;
}
case WSTRING_V:
case DATE_V:
case TIME_V:
case VALUE_V:
case VALUEARRAY_V:
case INT64_V:
case VOID_V:
case ERROR_V:
case VALUEMAP_V:
case UNKNOWN_V:
default:
NEVER();
break;
}
}
else
{
type = var.GetType();
xml.Attr("type", type);
switch(type)
{
case INT_V:
{
int i = var;
xml.Attr("value", i);
break;
}
case DOUBLE_V:
{
double d = var;
xml.Attr("value", d);
break;
}
case STRING_V:
{
String s = var;
xml.Attr("value", s);
break;
}
case BOOL_V:
{
bool b = var;
xml.Attr("value", b);
break;
}
case WSTRING_V:
case DATE_V:
case TIME_V:
case VALUE_V:
case VALUEARRAY_V:
case INT64_V:
case VOID_V:
case ERROR_V:
case VALUEMAP_V:
case UNKNOWN_V:
default:
NEVER();
break;
}
}
}
Ciao
Max
|
|
|
|
|
Xmlize values
By: mdelfede on Wed, 24 February 2010 00:12
|
|
|
Re: Xmlize values
By: mdelfede on Wed, 24 February 2010 00:20
|
|
|
Re: Xmlize values
By: koldo on Wed, 24 February 2010 12:14
|
|
|
Re: Xmlize values
By: mirek on Fri, 26 February 2010 11:57
|
|
|
Re: Xmlize values
By: koldo on Fri, 26 February 2010 12:27
|
|
|
Re: Xmlize values
By: mdelfede on Fri, 26 February 2010 12:37
|
|
|
Re: Xmlize values
By: mirek on Fri, 26 February 2010 13:12
|
|
|
Re: Xmlize values
By: mirek on Sun, 28 February 2010 15:08
|
|
|
Re: Xmlize values
By: koldo on Sun, 28 February 2010 15:44
|
|
|
Re: Xmlize values
By: mirek on Sun, 28 February 2010 17:03
|
|
|
Re: Xmlize values
By: koldo on Sun, 28 February 2010 17:32
|
|
|
Re: Xmlize values
By: mirek on Sun, 28 February 2010 23:09
|
|
|
Re: Xmlize values
By: mdelfede on Mon, 01 March 2010 09:53
|
|
|
Re: Xmlize values
By: mirek on Mon, 01 March 2010 10:20
|
|
|
Re: Xmlize values
|
|
|
Re: Xmlize values
By: mdelfede on Mon, 01 March 2010 11:08
|
|
|
Re: Xmlize values
|
|
|
Re: Xmlize values
By: mirek on Tue, 09 March 2010 09:35
|
|
|
Re: Xmlize values
|
|
|
Re: Xmlize values
By: mirek on Wed, 10 March 2010 08:55
|
|
|
Re: Xmlize values
By: mdelfede on Sun, 28 February 2010 20:41
|
Goto Forum:
Current Time: Sat Apr 27 13:36:14 CEST 2024
Total time taken to generate the page: 0.03079 seconds
|