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 » XmlIO - New function proposal
XmlIO - New function proposal [message #8602] Tue, 20 March 2007 23:22 Go to previous message
victorb is currently offline  victorb
Messages: 78
Registered: December 2005
Location: Nice, France
Member
My application is using XML to store/retrieve data. Many elements are using the same default value. In this case I don't want to store the attribute value in the XML but I want it restored to a default value (instead of Null) when reading the configuration back. I have added this new function to XmlIO class

	template <class T> XmlIO Attr(const char *id, T& var, T def) {
		if(IsLoading()) {
			XmlAttrLoad(var, node.Attr(id));
			var = Nvl(var, def);
		} else if (var != def) 
			node.SetAttr(id, XmlAttrStore(var));		
		return *this;
	}


Do you think it might be useful to have this in standard Upp ?
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: "Copy folder recursively" is there a function?
Next Topic: Unsafe Deep Copy
Goto Forum:
  


Current Time: Sun Jun 15 11:39:13 CEST 2025

Total time taken to generate the page: 0.03937 seconds