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 » (Possible) Serialization issue
Re: (Possible) Serialization issue [message #19002 is a reply to message #19001] Tue, 04 November 2008 11:29 Go to previous messageGo to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Mindtraveller

Even without using StoreToFile() I can`t use simple Serialize(), and U++ forces user to use StoreToFile/LoadFromFile. And it looks like Serialize(FileOut) uses the same magic header as Serialize(FileIn) doesn`t.

I don't see how you're forced to use StoreToFile/LoadFromFile, I actually rarely do. And I can assure you that Serialize does work and that there are no magic headers.

I appreciate your frustration, but I'm pretty sure that the problem here is something in your code.
- In your test above, there are no checks on 'fOut.Open(filenameConfig)' failing. This would cause fin to read garbage.
- Check your serialization. If StoreToFile/LoadFromFile works then this should be fine but a simple test would be:
        StringStream s;
        int64 inpos, outpos;
        
        // Write
        site.Serialize(s);
        outpos = s.GetPos();
        //Read
        s.SetLoading();
        s.Seek(0);
        site.Serialize(s);
        inpos = s.GetPos();
        ASSERT(inpos == outpos);

I hope that helps.
James
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Core/Ol_Set.cpp should to change!
Next Topic: [solved!] XML serialization and relative paths
Goto Forum:
  


Current Time: Sat May 11 19:18:32 CEST 2024

Total time taken to generate the page: 0.02692 seconds