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 » Value and Serialize
Value and Serialize [message #8849] Tue, 03 April 2007 17:33 Go to previous message
mubeta is currently offline  mubeta
Messages: 77
Registered: October 2006
Member
Hi,

From long time ago, I am using the following VectorMap declaration for managing some data:

//
VectorMap<int, Vector<Value> > MyData;
//

And with the following two functions, I store a lot of this data in some database, using "Serialization":

//
VectorMap<int, Vector<Value> > StringToVector(const String &s) {

StringStream ss(s);
VectorMap<int, Vector<Value> > m;
ss.SetLoading();
m.Serialize(ss);
//LoadFromString(m, s);
return m;
}

String VectorToString(VectorMap<int, Vector<Value> > &v) {

StringStream ss;
//ss.Create();
ss.SetStoring();
v.Serialize(ss);
return ss.GetResult();
//return StoreAsString(v);
}
//

I start to do this and compiling the application with UPP605. I give the application to some peoples, and now they have a lot of user file with data stored inside.
Now I am developing this application with UPP2007, but there is a problem: when I want to read the data stored in the file created in the past, the seralization don't recreate an correct VectorMap; the key values of the VectorMap it's correct, but not the values.

I have scanned manually the string generated with the old application, and I have compared with the string generated with new application. There is one difference: before every value of type "Value" it's preceded by the hex number 08, now in the new string of serialization there is the hex number 09.
With an hex editor I have changed some files, just modifying this number, and after this I am able to read well also the old files.

So, after this test, I think: maybe, in the past, the type "Value" is recognized from the compiler with the number 0x08, now, in the last upp the "Value" type is recognized as number 0x09.
That mean that using a non "native" data type it's dangerous for future compatibility?
And how I can force the compiler to give the same identifier for Upp data type, for each release of Upp?

Thanks
Mauro Bottizzo.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: StrDbl and decimal separator
Next Topic: !USEMALLOC
Goto Forum:
  


Current Time: Sun Apr 28 22:10:48 CEST 2024

Total time taken to generate the page: 0.03560 seconds