Sign in Join

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

Catalog · How the catalog works

Random project

sv-utils

Automatically exported from code.google.com/p/sv-utils

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

sv-utils

Projects: <ul> <li> svTrees – data structure (main unit svCollections.Trees.pas) for building TVirtualStringTree virtually. Just create TsvTree, add childs and use TVirtualStringTree's OnInitNode and OnInitChildren events. Demo project included. Third party Collections open source library included. Needs installed TVirtualStringTree. </li> <li> TColorVisualizer – debugger visualizer for Delphi 2010 and newer. It allows you to visually see TColor's representation in the debugger. Just compile and install the package. </li> </ul>

Project is imported from [https://code.google.com/p/sv-utils/](https://code.google.com/p/sv-utils/)

Resume by Dimsa: Look question on StackOverflow: [http://stackoverflow.com/questions/10559080/nested-json-object-deserializing-using-delphi-2012](http://stackoverflow.com/questions/10559080/nested-json-object-deserializing-using-delphi-2012)

With SvSerializer you can do like this:

TDropbox = class

private

pascal
&nbsp;&nbsp;FHash: string;
pascal
&nbsp;&nbsp;Fthumb_exists: Boolean;
pascal
&nbsp;&nbsp;...

public

pascal
&nbsp;&nbsp;[SvSerialize]
pascal
&nbsp;&nbsp;property Hash: string read FHash write FHash;
pascal
&nbsp;&nbsp;[SvSerialize]
pascal
&nbsp;&nbsp;property thumb_exists: Boolean read Fthumb_exists write Fthumb_exists;
pascal
&nbsp;&nbsp;...

Then you can add Object Instance to Serializer

FSerializer := TSvSerializer.Create();

FDropboxFile := TDropbox.Create;

FSerializer.AddObject('', FDropboxFile);

And now you can serialize/deserialize this object through SvSerializer:

FSerializer.DeSerialize(

pascal
&nbsp;&nbsp;mmo1.Lines.Text{your json string, stream or filename},
pascal
&nbsp;&nbsp;TEncoding.UTF8{if it is string you must specify the encoding});
pascal
&nbsp;&nbsp;//After this line your FDropBoxFile's properties are filled from your json string

SvSerializer is easy to use and is very similar to DataContract Serializer in C# or Serializer by NewtonSoft.
So you can easily go to SvSerializer in Delphi from C#
Good automatic Serializer in Delphi