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 » Xmlize and double
Xmlize and double [message #739] Mon, 30 January 2006 07:55 Go to previous message
pivica is currently offline  pivica
Messages: 57
Registered: November 2005
Location: Belgrade, Serbia
Member
How to save and load double into xml. On way to save double is to convert him to String, but when loading I can't find a way to convert that String back to double.



class SomeClass
{
  double d;
  Vector<double> vd;

  void Xmlize(XmlIO xml)
  {
    String sd;
    Vector<String> svd;
	
    if (xml.IsStoring())
    {
      sd = AsString(d);
      int n = vd.GetCount();
      for (int i = 0; i < n; ++i)
        svd.Add(AsString(vd[i]));
    }

    xml
     ("d", sd)
     ("vd", svd)
    ;
	
    if (xml.IsLoading())
    {
    // now what???
    }
  }
}
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: signature of the stou function
Next Topic: Serbian translation
Goto Forum:
  


Current Time: Wed Jun 05 18:14:46 CEST 2024

Total time taken to generate the page: 0.02504 seconds