Home » U++ Library support » U++ Core » Suggest Xmlize support for Value
Suggest Xmlize support for Value [message #15861] |
Tue, 13 May 2008 00:34 |
Mindtraveller
Messages: 917 Registered: August 2007 Location: Russia, Moscow rgn.
|
Experienced Contributor |
|
|
In the process of mastering U++ XML abilities I`ve met a problem with storing Value variables in XML, also with storing Value vectors and maps. I suggest following code to solve this problem:
template<> void Upp::Xmlize(XmlIO xml, Value& v)
{
if (xml.IsLoading())
{
String s;
xml.Attr("value", s);
StringStream ss(s);
ss.SetLoading();
ss % v;
}
else
{
StringStream ss;
ss.SetStoring();
ss % v;
xml.Attr("value",(String) ss);
}
}
P.S. Maybe it would also be useful to add raw data <-> string uuencoding if it is vital to comply XML standard at 100% (some XML readers doesn`t read "non standard" characters like ).
[Updated on: Tue, 13 May 2008 00:50] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat Apr 27 12:19:32 CEST 2024
Total time taken to generate the page: 0.02697 seconds
|