Skip to content
/ sv-utils Public

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

License

Notifications You must be signed in to change notification settings

dimsa/sv-utils

Repository files navigation

sv-utils

Projects:

  • 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.
  • 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.

Project is imported from 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

With SvSerializer you can do like this:
TDropbox = class
private
  FHash: string;
  Fthumb_exists: Boolean;
  ...
public
  [SvSerialize]
  property Hash: string read FHash write FHash;
  [SvSerialize]
  property thumb_exists: Boolean read Fthumb_exists write Fthumb_exists;
  ...

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(
  mmo1.Lines.Text{your json string, stream or filename},
  TEncoding.UTF8{if it is string you must specify the encoding});
  //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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published