dfm to json
v1.0.0.0
Convertir un DFM en JSON, pour plus d'informations sur le problème - Help Commande
Vous pouvez télécharger la dernière version ici.
Vous pouvez vérifier la grammaire (EBNF) ici.
Considérez cet échantillon DFM.DFM:
object Form1: TForm1
Left = 192
Font. Name = ' MS Sans Serif '
Font.Style = []
object Image1: TImage
Picture.Data = {
07544269746D617036550000424D365500000000000036000000280000005500
000055000000010018000000000000550000C40E0000C40E0000000000000000
}
end
object ListBox1: TListBox
Items.Strings =
( ' this is string. '
+ ' and another one... '
+ ' and another one... '
+ ' now with apostrophe '' ' # 13 # 10
+ ' even with control characters ' # 7 # 9 ' mixed in the string '
)
end
object DBGrid1: TDBGrid
Options = [dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgRowSelect, dgConfirmDelete, dgCancelOnExit]
Columns = <
item
Expanded = False
Visible = True
end
item
Expanded = False
Visible = True
end >
end
endExécution de la commande:
$ dfm-to-json resources/sample.dfmproduit le JSON suivant:
{
"kind" : " object " ,
"name" : " Form1 " ,
"type" : {
"name" : " TForm1 " ,
"index" : null
},
"properties" : {
"font.name" : " MS Sans Serif " ,
"font.style" : [],
"left" : 192
},
"objects" : [
{
"kind" : " object " ,
"name" : " Image1 " ,
"type" : {
"name" : " TImage " ,
"index" : null
},
"properties" : {
"picture.data" : " 07544269746D617036550000424D365500000000000036000000280000005500000055000000010018000000000000550000C40E0000C40E0000000000000000 "
},
"objects" : []
},
{
"kind" : " object " ,
"name" : " ListBox1 " ,
"type" : {
"name" : " TListBox " ,
"index" : null
},
"properties" : {
"items.strings" : [
" this is string.and another one...and another one...now with apostrophe ' rn even with control characters u0007 t mixed in the string "
]
},
"objects" : []
},
{
"kind" : " object " ,
"name" : " DBGrid1 " ,
"type" : {
"name" : " TDBGrid " ,
"index" : null
},
"properties" : {
"columns" : {
"items" : [
{
"name" : " item " ,
"properties" : {
"expanded" : false ,
"visible" : true
}
},
{
"name" : " item " ,
"properties" : {
"expanded" : false ,
"visible" : true
}
}
]
},
"options" : [
" dgTitles " ,
" dgIndicator " ,
" dgColumnResize " ,
" dgColLines " ,
" dgRowLines " ,
" dgTabs " ,
" dgRowSelect " ,
" dgConfirmDelete " ,
" dgCancelOnExit "
]
},
"objects" : []
}
]
}$ git clone https://github.com/jean-lopes/dfm-to-json.git
$ cd dfm-to-json
$ stack install
$ dfm-to-json --version Si vous ne pouvez pas exécuter la dernière commande, cela signifie que vous n'avez pas le répertoire stack install par défaut dans votre variable PATH environnement. Vérifiez le chemin local
Conseil pour les utilisateurs de Windows: stack par défaut local-bin-path est: %APPDATA%localbin