Ecere SDK/eC Forums • View topic - Serialization

Ecere SDK/eC Forums

Ecere Developers Community


General help with the Ecere Cross Platform GUI toolkit: Window, common controls, events, etc.
Help with the 2D Graphics library: Surface, Display, Bitmap, Font and others.


Postby samsam598 » Wed Oct 02, 2013 6:33 am

In sample openrider it seems serialization and unserialization have been used.Am I correct?I want to learn more on the topic in eC.Any more informations and guidance would be appreicated.
Posts: 208
Joined: Thu Apr 14, 2011 9:44 pm

Re: Serialization

Postby jerome » Wed Oct 02, 2013 1:19 pm

Hi Sam,

Yes I recently fixed some bugs relating to how these methods work, especially with the normal 'class' objects.

OnSerialize / OnUnserialize are part of the methods every type has.

There is also a default implementation for all types.

You can serialize / unserialize from an IOChannel class (File also inherits from IOChannel).

So you can do File f = FileOpen("someFile", write); f.Put(myObject) to serialize and f.Get(myObject) to deserialize.

Then you can override the default behavior if you want to control how a particular class is to be serialized/deserialized.

(De)Serialization is also used in EDA to store to or retrieve from a database types the database doesn't natively supports (blobs), and for network communication (e.g. distributed objects: remote class).

That's the basics! Let me know if you have any further questions.


Site Admin
Posts: 623
Joined: Sat Jan 16, 2010 11:16 pm

Return to GUI Toolkit & 2D Graphics

Who is online

Users browsing this forum: No registered users and 3 guests