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 » XmlNode Copy Constructor
XmlNode Copy Constructor [message #10332] Mon, 02 July 2007 21:19 Go to next message
h3l1 is currently offline  h3l1
Messages: 28
Registered: August 2006
Location: Innsbruck, Austria
Promising Member
Hi there,

Is there a possibility to have a copy constructor in the XmlNode, so I can store nodes into an array.

Thanks
Heli
Re: XmlNode Copy Constructor [message #10343 is a reply to message #10332] Tue, 03 July 2007 11:55 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14112
Registered: November 2005
Ultimate Member
Pick constructor is not enough?
Re: XmlNode Copy Constructor [message #10347 is a reply to message #10343] Tue, 03 July 2007 12:51 Go to previous messageGo to next message
h3l1 is currently offline  h3l1
Messages: 28
Registered: August 2006
Location: Innsbruck, Austria
Promising Member
Sorry for my ignorance, but I don't actually know what a pick constructor is.

I tried to add a xmlnode to an arraymap with add. With mingw it works, but the ms compiler complains about it doesn't find a matching DeepCopyNew method.

I did the following:
loading an xmlfile and parsing it
  root=ParseXml(text);
  const XmlNode &node = root[TAG_NAME];
  for (int i = 0; i < node.GetCount(); i++)
    arraymap.add(node[i].GetTag(), node[i]);


Could you please provide an example how to use a pick constructor.
Edit: As far as I read in the manual the pick constructor delivers only an empty and fresh initialized object.

Thanks
Heli

[Updated on: Tue, 03 July 2007 13:11]

Report message to a moderator

Re: XmlNode Copy Constructor [message #10360 is a reply to message #10347] Wed, 04 July 2007 07:32 Go to previous message
mirek is currently offline  mirek
Messages: 14112
Registered: November 2005
Ultimate Member
Use AddPick instead of Add. The disadvantage is that the source node will be destroyed in the process. (The advantage is that it will be much faster than deep copy Wink.

Anyway, something like this is quite untypical. Is there any further context you can describe?

Mirek
Previous Topic: Make TimeStop "Moveable"?
Next Topic: inline UPP::int64 abs(UPP::int64 x)
Goto Forum:
  


Current Time: Sun Nov 10 20:42:09 CET 2024

Total time taken to generate the page: 0.02436 seconds