Table of Contents

TTMSFNCJSONToClass.ExportToDelphiFromFile Method

Generates Delphi class source from JSON stored in a file using default options.

API unit family: TMSFNCPersistence Declaring type: TTMSFNCJSONToClass

Overloads

Overload 1

Generates Delphi class source from JSON stored in a file using default options.

class function ExportToDelphiFromFile(AFileName: string; ACallBack: TTMSFNCJSONToClassExportEvent = nil): string; overload;

Parameters

Name Description
AFileName Path to the JSON file used as the source schema.
ACallBack Optional callback that can adjust generated property names and types.

Returns

The generated Delphi source text.

Overload 2

Generates Delphi class source from JSON stored in a file using the specified options.

class function ExportToDelphiFromFile(AFileName: string; AOptions: TTMSFNCJSONToClassOptions; ACallBack: TTMSFNCJSONToClassExportEvent = nil): string; overload;

Parameters

Name Description
AFileName Path to the JSON file used as the source schema.
AOptions Generation options for class names, members, unit output, and implementation output.
ACallBack Optional callback that can adjust generated property names and types.

Returns

The generated Delphi source text.