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 » Suggest Xmlize support for Value
Suggest Xmlize support for Value [message #15861] Tue, 13 May 2008 00:34 Go to previous message
Mindtraveller is currently offline  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 &#x03;).

[Updated on: Tue, 13 May 2008 00:50]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Upp::Time::Get() missing const
Next Topic: Can we get a Join that uses WString?
Goto Forum:
  


Current Time: Sat Apr 27 12:19:32 CEST 2024

Total time taken to generate the page: 0.02697 seconds