U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Core » serialization
Re: serialization [message #2161 is a reply to message #2144] Sun, 02 April 2006 17:51 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
gprentice wrote on Sun, 02 April 2006 07:18


In the serialize reference example, this code appears to cleverly handle both the saving and restoring - is that correct?

	void Serialize(Stream& s)
	{
		s % q % text % data;
	}




Yes.

Quote:


Suppose you have 100 items to save/restore - is there any reason not to chain all together in one long expression?



Usually not (see e.g. ide/idewin.cpp line 41 Smile

Quote:


Comparing with .ini file, suppose some objects get removed - is there any alternative to having "dummy" objects of the correct type so that you can still read in data that was saved with now obsolete items?



Well, not really. Binary serialization has its limitations. In fact, I would not recommend it for "robust" data storage, e.g. for storing documents. We are using it for e.g. configuration files, passing data over network or backuping data for implementation reasons (e.g. Cancel in dialogs can be implemented using serialization - before stating dialog, its content is serialized into String, Cancel serializes it back).

Mirek
 
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: c++ 17 support
Next Topic: strange behaviour of Vector serialization
Goto Forum:
  


Current Time: Fri Sep 11 13:40:38 GMT+2 2026

Total time taken to generate the page: 0.00744 seconds