|
|
Home » U++ Library support » U++ Core » serialization
serialization [message #2144] |
Sun, 02 April 2006 13:18 |
gprentice
Messages: 260 Registered: November 2005 Location: New Zealand
|
Experienced Member |
|
|
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;
}
Suppose you have 100 items to save/restore - is there any reason not to chain all together in one long expression?
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?
Graeme
|
|
|
Re: serialization [message #2161 is a reply to message #2144] |
Sun, 02 April 2006 17:51 |
|
mirek
Messages: 13984 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
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
|
|
|
Re: serialization [message #2284 is a reply to message #2161] |
Wed, 05 April 2006 19:28 |
barpas
Messages: 13 Registered: March 2006 Location: Poland
|
Promising Member |
|
|
halo everybody
i have problem with serialization - some time ago i writen application in upp where i use serialization mechanism to save options & parameters (there is a lot of serialize functions) - now i have problem user told that anybody can edit that files and read (change) information abaut program
so i need to code it - is there simple metod to do it fast (i have litle bit of time)
[Updated on: Wed, 05 April 2006 20:22] Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: serialization [message #16804 is a reply to message #14941] |
Sat, 12 July 2008 11:43 |
|
chickenk wrote on Thu, 20 March 2008 23:23 | What about YAML? (http://www.yaml.org)
It can embed base64 encoded binary chunks...
I believe a C implementation is present here: http://pyyaml.org/wiki/LibYAML
I'm quite fond of YAML when talking about serialization tasks, but maybe it's not suited for you... If I had more time, I would consider making a C++ wrapper around libYAML using U++ technology.
If anyone interested...
Lionel
|
Good idea!
|
|
|
|
|
Goto Forum:
Current Time: Thu Jun 13 06:26:17 CEST 2024
Total time taken to generate the page: 0.01561 seconds
|
|
|