Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2016-04

Framework for Objects Serialization / Deserialization

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mazola Winstrol

Hello list,

Is there a fpc framework for or some standard to serialize / deserialize classes and other custom types?

Regards

Reply by email

Michael Van Canneyt
to Mazola Winstrol
Mazola Winstrol wrote
Hello list, Is there a fpc framework for or some standard to serialize / deserialize classes and other custom types?

At least two units offer the base for such functionality: jsonrtti (fcl-json) and restbase (fcl-web)

And obviously any TComponent can be streamed in the Delphi-native format.

Michael.

Reply by email

Mazola Winstrol
to Michael Van Canneyt

2016-04-01 3:46 GMT-03:00 Michael Van Canneyt :

Show quoted text 16 lines
On Fri, 1 Apr 2016, Mazola Winstrol wrote: Hello list, > > Is there a fpc framework for or some standard to serialize / deserialize > classes and other custom types? > At least two units offer the base for such functionality: jsonrtti (fcl-json) and restbase (fcl-web) And obviously any TComponent can be streamed in the Delphi-native format.

Thanks for your reply Michael.

I can't change the actual hierarchical structure of my classes so i can't use TComponent.

I can serialize custom types (e.g records) using fcl-json?

Delphi do have an intersting way to do with serialization: they have some standard classes (TTypeMashaller, TConverter). If one wants to serialize to a new format (e.g binary format), one can extended those base classes and implement such serialization. Would be interesting if we create an infrastructure like that.

http://docwiki.embarcadero.com/RADStudio/Seattle/en/Serializing_User_Objects

Reply by email

Dmitry Boyarintsev
to Mazola Winstrol
Mazola Winstrol wrote 9 lines
I can't change the actual hierarchical structure of my classes so i can't use TComponent. Delphi do have an intersting way to do with serialization: they have some standard classes (TTypeMashaller, TConverter). If one wants to serialize to a new format (e.g binary format), one can extended those base classes and implement such serialization. Would be interesting if we create an infrastructure like that.

That might be handy.

In order to support Xcode project file (.pbx) structures I had to create a stand-alone (de)serializers from scratch.
It's RTTI dependent, but is not based of TComponent. It would also not fail, if encounters unrecognized property, instead would keep it for the later serialization ( .pbx is undocumented and could change without notice )

thanks,
Dmitry

Reply by email