Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

10.2 Tokyo TJsonSerializer and JSON.Converters

Author: h.mohri


 

First declare with Pascal to use the converter and generics.

[crayon-6719db226096c953668900/]

This is because the use of generics in C++Builder. C++Builder used Win64.

[crayon-6719db2260975675077672/]

Include each file.

This time I tried TJsonListConverter and TJsonStringDictionaryConverter.

TJsonListConverter converts TList<T> to JSON. TJsonStringDictionaryConverter converts TDictionary<String, T> to JSON.

placed two buttons on the TForm.

It outputs a json string of after-converted to TMemo.

[crayon-6719db2260978430062901/]

Button1 is TList<String> to JSON Convert. Button2 is TDictionary<String, String>to JSON.


 

It will be like this when executed.

 

 

 

 

Exit mobile version